News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

newbie framework problem

Started by roar, September 15, 2006, 12:49:00 PM

Previous topic - Next topic

roar

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.

roar

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.

hitchhikr

You may want to enable GL_DEPTH_TEST & disable GL_BLEND if it's active.