Position objects.. newbie question

Started by
7 comments, last by Darjk 22 years, 2 months ago
Hello, I''m very new to the OpenGL scene and have been following the NeHe tutorials but have found them to lack info on this simple area. Basically, lets say I have 5 balls/objects and I want to position them ? I thought glTranslatef() would do this but that does not appear to be the case or I''m doing something wrong. Most the NeHe tutorials are dealing with static objects or only 1 object. Basically I have the floor, just a quad, and I have a ball mesh/object/vertices. Basically when drawing the balls what is the best way to draw them ? I was Adding the position (which i''m grabbing from an array) to the vertices, but surely there has to be a better way, or an GL command to do this ? and as a side note, where can I get the Open GL SDK that explains all the functions, etc ? I''ve downloaded several things from opengl.org but none of them had this info. Thanks in advance!
Advertisement
Never mind, I think I found my answer with glPushMatrix()
Glad you found your answer.
quote:Original post by Darjk
and as a side note, where can I get the Open GL SDK that explains all the functions, etc ? I've downloaded several things from opengl.org but none of them had this info.



OpenGL® Reference Manual: The Official Reference Document to OpenGL, Version 1.2, 3/e


OpenGL Architecture Review Board

Publisher: Addison Wesley
Copyright: 2000
Format: Paper, 704 pp
ISBN: 0-201-65765-1
Status: Published 12/23/1999
Retail Price: $54.99 US





Edited by - Fruny on February 16, 2002 3:29:28 AM
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Ran into more problems, after scaling say, the floor..
Is it possible to "reset" the scale back to what ever the default is without reseting the whole view ?
Just add more push/pop : set the view, push, scale the floor, pop.
Or do it the hard way with a second call to glScale*() with the complementary ratios.

"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Ahhhh... cheers, that did the trick!
You have no idea how long I''ve been trying to figure out some of these glFunctions.

Been programming with DirectX for about 3 years but after seeing how much easier the coding was with OpenGL I figured I''d start to teach myself. I guess I''ll have to invest in that book you suggested above.

Thanks again.
There is also the Red Book (OpenGL Programming Guide) which is actually geared to teach you OpenGL. The Blue Book is the complete reference, all the functions in alphabetical order, with the parameters, constants & everything (i.e. something that isn''t available for DX... I hate online manuals).

I know books are expensive, but when you are serious about programming, you quickly find out that you need them (at least the good ref manuals).
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
The blue book should be all I need, the theories and how it all works should remain similar to DX, if not.. I guess Im in trouble
Red Book online here.

It''s an old version, but it is better than nothing. Go read it.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan

This topic is closed to new replies.

Advertisement