Jump to content
  • Advertisement

Archived

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

joshfly

Triangle...

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

Advertisement
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 GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!