OpenGL: glRotate and some 3D questions.
I've been reading NeHe's OpenGL tutorials, and I don't understand glRotate. I see how it works, but how does one take glRotate and apply it to the plane? I mean, the plane in NeHe's work's coordinate's are just
I don't see any rotated variables? And where's the connection between rquad and the Quad's coords?
PS. It looks as if NeHe is using predefined perspective algorithms. Where do they affect the shapes?
Code:
glVertex3f(-1.0f, 1.0f, 0.0f); // Top Left Of The Quad
glVertex3f( 1.0f, 1.0f, 0.0f); // Top Right Of The Quad
glVertex3f( 1.0f,-1.0f, 0.0f); // Bottom Right Of The Quad
glVertex3f(-1.0f,-1.0f, 0.0f);I don't see any rotated variables? And where's the connection between rquad and the Quad's coords?
PS. It looks as if NeHe is using predefined perspective algorithms. Where do they affect the shapes?
~ Bring a Pen ~
OpenGL is stateful. Things like the current matrix transformation are kept track of internally. When you call a function like glRotate, you're performing an operation that modifies the current transformation matrix. When you call glVertex, the coordinates you specify are multiplied by the projection and modelview matrices before being rasterized.
The above is a very simplified explanation; the OpenGL Red book (an old version is available online) explains all of this in greater detail than I'd be able to. I'd highly recommend it as a learning resource.
The above is a very simplified explanation; the OpenGL Red book (an old version is available online) explains all of this in greater detail than I'd be able to. I'd highly recommend it as a learning resource.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| OpenGL ES2... many questions | vunterslaush | 39 | 20,756 |
Sep 5, 2011 09:21 AM Last Post: ipeku |
|
| OpenGL ES questions regarding 2D mixed with 3D | jeonghyunhan | 5 | 5,423 |
Jun 20, 2009 03:54 PM Last Post: jeonghyunhan |
|
| Basic OpenGL questions | Mercy | 5 | 4,088 |
Dec 23, 2008 10:25 AM Last Post: AnotherJake |
|
| Some OpenGL 2D questions | oskob | 16 | 8,764 |
Oct 30, 2008 12:12 PM Last Post: Wowbagger |
|
| Dreaded noob questions: OpenGL in a Cocoa App | 5thPeriodProductions | 5 | 4,018 |
Apr 10, 2006 11:08 AM Last Post: 5thPeriodProductions |
|

