Advertisement Jump to content


This topic is now archived and is closed to further replies.



This topic is 5436 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

glVertexXX draws a vertex (a point), 3 vertices create a triangle (GL_TRIANGLES).
The values passed to glVertexXX are coordinates and form a 2d or 3d point. In the example it is probably something like this:

glBegin(GL_TRIANGLES); // Begin drawing triangles
glVertex2f(0.0f,0.0f); // First vertex (vertices are 2-dimensional and arguments are passed as float variables 2(2d)f(float))
glVertex2f(1.0f,0.0f); // Second vertex
glVertex2f(1.0f,1.0f); // Third vertex, the triangle is automatically drawn now
glEnd(); // End drawing triangles

so grab a piece of grid paper and draw the triangle you want, then use the coordinates of the corners as arguments. To just scale either ust multiply all coordinates with a certain value, of use glScalef(x,y,z).

Share this post

Link to post
Share on other sites
optianally in ur glResize Function change the line
making the 45 less would make things looke closer (until wrapped around to -) and making and making it greater would make things look further(all the things you draw)

gluPerspective (45.0f, (GLfloat)(width*0.75f)/(GLfloat)height), 1.0f, 100.0f);

Other wise try : glTranslatef(0,0,+1);

or make the triangle bigger

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!