<br><br><div><span class="gmail_quote">On 9/21/06, <b class="gmail_sendername">Charlie Burrows</b> <<a href="mailto:charlie.burrows@gmail.com">charlie.burrows@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>I've been trying to do the nehe tutorials in cl-opengl and I've got<br>the first two working but there's a small problem. It is probably an<br>opengl issue rather than a cl-opengl problem but I'm sure all you nice<br>
people won't mind my ignorance (too much) and besides where else could<br>I post my code and get a reply!<br><br>Ok so I've got two classes; the first one works find (as far as it<br>goes) the second also works but only if I don't enable depth testing.
<br>If I enable depth testing then the two shapes I draw disappear.<br>The code is here: <a href="http://paste.lisp.org/display/26461">http://paste.lisp.org/display/26461</a></blockquote><div><br>I wonder why you ever see anything. Where are you setting the color? I must be missing something since you say you see something without depth testing. This is nehe-2? nehe-2 sets colors:
<br><br>int DrawGLScene(GLvoid) // Here's Where We Do All The Drawing<br>{<br> glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear Screen And Depth Buffer<br> glLoadIdentity(); // Reset The Current Modelview Matrix
<br> glTranslatef(-1.5f,0.0f,-6.0f); // Move Left 1.5 Units And Into The Screen 6.0<br> glBegin(GL_TRIANGLES); // Drawing Using Triangles<br> glColor3f(1.0f
,0.0f,0.0f); // Set The Color To Red<br> glVertex3f( 0.0f, 1.0f, 0.0f); // Top<br> glColor3f(0.0f,1.0f,0.0f); // Set The Color To Green<br> glVertex3f(-
1.0f,-1.0f, 0.0f); // Bottom Left<br> glColor3f(0.0f,0.0f,1.0f); // Set The Color To Blue<br> glVertex3f( 1.0f,-1.0f, 0.0f); // Bottom Right<br> glEnd(); // Finished Drawing The Triangle
<br> glTranslatef(3.0f,0.0f,0.0f); // Move Right 3 Units<br> glColor3f(0.5f,0.5f,1.0f); // Set The Color To Blue One Time Only<br> glBegin(GL_QUADS); // Draw A Quad
<br> glVertex3f(-1.0f, 1.0f, 0.0f); // Top Left<br> glVertex3f( 1.0f, 1.0f, 0.0f); // Top Right<br> glVertex3f( 1.0f,-1.0f, 0.0f); // Bottom Right
<br> glVertex3f(-1.0f,-1.0f, 0.0f); // Bottom Left<br> glEnd(); // Done Drawing The Quad<br> return TRUE; // Keep Going
<br>}<br><br>Confused.<br><br>kt<br><br>ps. I suggest you make each example standalone and not try to inherit code for lesson 2 from lesson 1 if this is going to be stuff in a public library. Of course if you just want to mix in CLOS training I understand, but it may compromise the value of the contrib to cl-opengl. kt
<br></div></div>