Advertisement

Qt Problem [wrong source code??]

Started by October 15, 2003 12:04 PM
1 comment, last by VisionD 21 years, 4 months ago
Hi people, i have a problem moving from tutorial 2 to tut 3 using Qt. I tried to use smooth coloring for the triangle but it OpenGL (??) just sets the last color i use between the glbegin and glend command. This is my code: glBegin(GL_TRIANGLES); // Drawing Using Triangles glColor3f(1.0f,0.0f,0.0f); glVertex3f( 0.0f, 1.0f, 0.0f); // Top glColor3f(0.0f,1.0f,0.0f); glVertex3f(-1.0f,-1.0f, 0.0f); // Bottom Left glColor3f(0.0f,0.0f,1.0f); glVertex3f( 1.0f,-1.0f, 0.0f); // Bottom Right glEnd(); // Finished Drawing The Triangle The rest is exactly the code from the Qt/C++ example in the second tut. Why isn''t this working?? Is is a Qt - widget problem?? Thx for any help. VisionD
--~( I like cheesy poofs... )~--
You code is correct, please post the full draw function.

========================
Leyder Dylan (dylan.leyder@slug-production.be.tf
http://www.slug-production.be.tf/
========================Leyder Dylan (dylan.leyder@slug-production.be.tf http://users.skynet.be/fa550206/Slug-Production/Index.htm/
Advertisement
Are you using goraud shading? put this in your init function.

glShadeModel(GL_SMOOTH);

This topic is closed to new replies.

Advertisement