Public Group

beginner opengl Nehe Lesson 2 question

This topic is 4110 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

This question is just for clarification. So in this lesson, I'm guessing most people know this series, u add the following code:

glTranslatef(-1.5f,0.0f,-6.0f);

glBegin(GL_TRIANGLES);
glVertex3f( 0.0f, 1.0f, 0.0f);
glVertex3f(-1.0f,-1.0f, 0.0f);
glVertex3f( 1.0f,-1.0f, 0.0f);
glEnd();

glTranslatef(3.0f,0.0f,0.0f);

glVertex3f(-1.0f, 1.0f, 0.0f);
glVertex3f( 1.0f, 1.0f, 0.0f);
glVertex3f( 1.0f,-1.0f, 0.0f);
glVertex3f(-1.0f,-1.0f, 0.0f);
glEnd();

I was wondering if when you use "glVertex3f( 0.0f, 1.0f, 0.0f);" if your location is offset by that amount or if your looking at the point corresponding to your current position w/o changing your location.

Share on other sites
The vertex locations in OpenGL are absolute, that's it, the instruction you picke will just create the vertex at coordinate ( 0, 1, 0), working on rectagukar coordinates.

For offseting, the thing used is the modelview matrix.

Share on other sites
(just a friendly tip --might be a little off;topic--)
Im not a hater or something , but , if you want my opinion , avoid reading nehe's tutorials.
Better read opengl redbook , or even better get game tutorials squared package...
(dont kill me , thats my opinion)

1. 1
2. 2
Rutin
18
3. 3
4. 4
5. 5

• 13
• 14
• 9
• 9
• 9
• Forum Statistics

• Total Topics
632925
• Total Posts
3009237
• Who's Online (See full list)

There are no registered users currently online

×