• ### What is your GameDev Story?

#### Archived

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

# Triangle...

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

## Recommended Posts

How do i sketch a triagnle to be larger??

##### Share on other sites
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 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

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 15
• 9
• 11
• 9
• 9
• ### Forum Statistics

• Total Topics
634133
• Total Posts
3015748
×