The MASM Forum Archive 2004 to 2012

Project Support Forums => OpenGL Forum => Topic started by: roar on September 15, 2006, 12:49:00 PM

Title: newbie framework problem
Post by: roar on September 15, 2006, 12:49:00 PM
Hello!

I'm pretty new to assembler and opengl.
I've been trying to use Your framework to make some primitve rectangles, but I've encountered a problem. I'm trying to create a sort of cube and view it from the inside. The problem is that the left wall is displayed properly, but the right one does not appear on the screen. I have no idea why it's so. Here's the sample code:


invoke glBegin, GL_QUADS
;left wall
invoke glColor3f, CFLT(0.10), CFLT(0.53), CFLT(0.13)
invoke glVertex3f, CFLT(-1.0), CFLT(0.0), CFLT(2.0)
invoke glVertex3f, CFLT(-1.0), CFLT(0.0), CFLT(-2.0)
invoke glVertex3f, CFLT(-1.0), CFLT(0.5), CFLT(-2.0)
invoke glVertex3f, CFLT(-1.0), CFLT(0.5), CFLT(2.0)
;right wall
invoke glColor3f, CFLT(0.8), CFLT(0.0), CFLT(0.13)
invoke glVertex3f, CFLT(1.0), CFLT(0.5), CFLT(-2.0)
invoke glVertex3f, CFLT(1.0), CFLT(0.5), CFLT(2.0)
invoke glVertex3f, CFLT(1.0), CFLT(0.0), CFLT(2.0)
invoke glVertex3f, CFLT(1.0), CFLT(0.0), CFLT(-2.0)

invoke glEnd


The walls ale supposed to be symethrical, so I should be able to see them both from the point (0,0,0) but it doesn't happen.

Please, tell me what am I doing wrong.
Title: Re: newbie framework problem
Post by: roar on September 17, 2006, 07:14:54 PM
Hello again.

Sorry for that lame question - i found the answer here, if anyone asks: http://www.masm32.com/board/index.php?topic=2853.0

I have another question  :bg
I'm writing some code that is supposed to draw a scene consisting of many simple quads, it's a sort of a maze. The problem is that the walls act as if they were transparent, I can see what's behind them (other walls, which are created later on in the program).

How could I fix it? I know one way - to start drawing from the most distant objects and moving forward to the observer, but it's a "little" complicated... Is there any way other than sorting the objects to make it work?

I would appreciate any help.
Title: Re: newbie framework problem
Post by: hitchhikr on September 21, 2006, 06:15:25 PM
You may want to enable GL_DEPTH_TEST & disable GL_BLEND if it's active.