Skip to main content
gamedev.net
🔒 Locked

Triangle...

Started by joshfly Mar 5, 2004 at 6:24 AM 1 replies 350+ views
Original Post
joshfly
joshfly
How do i sketch a triagnle to be larger??
Tree Penguin
Tree Penguin
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).
dawid
dawid
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
Spy

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.