PDA

View Full Version : generating traingle in qt using openGL



Mashkur
16th October 2012, 20:01
Hey guys,whenever I try to draw a triangle in Qt using opengl instructions. i am getting the same triangle even if I change the vertices.How to solve this.?I am attaching the image of the triangle which is same for both the set of instrs given below.
1) glClear(GL_COLOR_BUFFER_BIT);

glColor3f(1,0,0);
glBegin(GL_TRIANGLES);
glVertex3f(50,50,0.0);
glVertex3f(50,-50,0.0);
glVertex3f(-50,-50,0.0);
glEnd();

1) glClear(GL_COLOR_BUFFER_BIT);

glColor3f(1,0,0);
glBegin(GL_TRIANGLES);
glVertex3f(5,5,0.0);
glVertex3f(5,-5,0.0);
glVertex3f(-5,-5,0.0);
glEnd();

wysota
16th October 2012, 21:17
How did you set up the viewport?