Hi, I've been trying to do the nehe tutorials in cl-opengl and I've got the first two working but there's a small problem. It is probably an opengl issue rather than a cl-opengl problem but I'm sure all you nice people won't mind my ignorance (too much) and besides where else could I post my code and get a reply!
Ok so I've got two classes; the first one works find (as far as it goes) the second also works but only if I don't enable depth testing. If I enable depth testing then the two shapes I draw disappear. The code is here: http://paste.lisp.org/display/26461
In the mean time I will continue with the tutorials.
Cheers, Charlie --- Kenny made me do it!
On 9/21/06, Charlie Burrows charlie.burrows@gmail.com wrote:
I've been trying to do the nehe tutorials in cl-opengl and I've got the first two working but there's a small problem. It is probably an opengl issue rather than a cl-opengl problem but I'm sure all you nice people won't mind my ignorance (too much) and besides where else could I post my code and get a reply!
I don't have much time to try your code at the moment, maybe someone else can run it and debug it, though. Anyway, just wanted to tell you that patches adding NeHe code to the examples directories are most welcome. Try to follow the coding conventions in the other examples if possible.
Also, comments regarding the GLUT CLOS API (ah, 3 acronyms in a row) are also welcome. It's mostly an experiment since GLUT sucks, but still. :)
On 9/21/06, Luís Oliveira luismbo@gmail.com wrote:
I don't have much time to try your code at the moment, maybe someone else can run it and debug it, though. Anyway, just wanted to tell you that patches adding NeHe code to the examples directories are most welcome. Try to follow the coding conventions in the other examples if possible.
Yup, no problem. I'm pretty much copying the redbook examples structure and trying to go from there.
Also, comments regarding the GLUT CLOS API (ah, 3 acronyms in a row) are also welcome. It's mostly an experiment since GLUT sucks, but still. :)
I haven't used glut enough to say if its good or bad in general. I just like the fact that I don't have to invoke (and therefore require) a random windowing library so I don't know how deeply I'll explore glut. Like I said, I'm new to gl so I can't say what I'm going to use or not. So far I really like the GCA (not just a TLA but a TAA) but I'll let you know if anything irritates me!
Cheers, Charlie
On 9/21/06, Charlie Burrows charlie.burrows@gmail.com wrote:
Hi, I've been trying to do the nehe tutorials in cl-opengl and I've got the first two working but there's a small problem. It is probably an opengl issue rather than a cl-opengl problem but I'm sure all you nice people won't mind my ignorance (too much) and besides where else could I post my code and get a reply!
Ok so I've got two classes; the first one works find (as far as it goes) the second also works but only if I don't enable depth testing. If I enable depth testing then the two shapes I draw disappear. The code is here: http://paste.lisp.org/display/26461
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:
int DrawGLScene(GLvoid) // Here's Where We Do All The Drawing { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear Screen And Depth Buffer glLoadIdentity(); // Reset The Current Modelview Matrix glTranslatef(-1.5f,0.0f,-6.0f); // Move Left 1.5Units And Into The Screen 6.0 glBegin(GL_TRIANGLES); // Drawing Using Triangles glColor3f(1.0f,0.0f,0.0f); // Set The Color To Red glVertex3f( 0.0f, 1.0f, 0.0f); // Top glColor3f(0.0f,1.0f,0.0f); // Set The Color To Green glVertex3f(-1.0f,-1.0f, 0.0f); // Bottom Left glColor3f(0.0f,0.0f,1.0f); // Set The Color To Blue glVertex3f( 1.0f,-1.0f, 0.0f); // Bottom Right glEnd(); // Finished Drawing The Triangle glTranslatef(3.0f,0.0f,0.0f); // Move Right 3 Units glColor3f(0.5f,0.5f,1.0f); // Set The Color To Blue One Time Only glBegin(GL_QUADS); // Draw A Quad glVertex3f(-1.0f, 1.0f, 0.0f); // Top Left glVertex3f( 1.0f, 1.0f, 0.0f); // Top Right glVertex3f( 1.0f,-1.0f, 0.0f); // Bottom Right glVertex3f(-1.0f,-1.0f, 0.0f); // Bottom Left glEnd(); // Done Drawing The Quad return TRUE; // Keep Going }
Confused.
kt
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
cl-opengl-devel@common-lisp.net