• Advertisement
Sign in to follow this  

beginner opengl Nehe Lesson 2 question

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

If you intended to correct an error in the post then please contact us.

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:
	
glLoadIdentity();								
	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);			
	
	glBegin(GL_QUADS);				
		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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement