News:

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

Ok, so I tried something new.

Started by OceanJeff32, September 30, 2005, 01:50:04 AM

Previous topic - Next topic

OceanJeff32

I found some interesting things in the openGL manual...Almost reminds one of LOGO (anyone remember that? the turtle before the mouse came along?)

I know just what a teacher wants to hear!!! LOL

The attached demo creates a triangle on screen, but the QUAD won't show it's face, any clue why?

Just messing around,

Jeff C
:dance:

P.S. If you put this .zip file in the examples directory, when it unzips the new working directory for Tri_Quad_1 will be created, and the release.bat file compiles to the working directory, not the BIN directory. (Although that can be easily changed)

[attachment deleted by admin]
Any good programmer knows, every large and/or small job, is equally large, to the programmer!

hitchhikr

Because of this:


invoke  glEnable, GL_CULL_FACE


Ogl eliminates back faces.

Use this instead:


invoke  glVertex3f, CFLT(-1.0), CFLT(1.0), CFLT(0.0)
invoke  glVertex3f, CFLT(-1.0), CFLT(-1.0), CFLT(0.0)
invoke  glVertex3f, CFLT(1.0), CFLT(-1.0), CFLT(0.0)
invoke  glVertex3f, CFLT(1.0), CFLT(1.0), CFLT(0.0)


(Counter-ClockWise).

You can select the kind of faces rendered by ogl with glFrontFace()
since GL_CCW is the default value, set it to GL_CW to only draw the faces with clockwise order.

If you use:


invoke  glDisable, GL_CULL_FACE


or just remove the statement (default is disabled), all faces will be rendered.

Also be aware that if you do some matrix translation at x = -1.5 the next translation will start from that coodinate so translating to x = 1.0 will give you x = -0.5 as base coordinate.

OceanJeff32

Amazing.

It's fixed, but I adjusted one more variable.


invoke  glTranslatef, CFLT(3.0), CFLT(0.0), CFLT(0.0)
invoke  glBegin, GL_QUADS
invoke  glVertex3f, CFLT(-1.0), CFLT(1.0), CFLT(0.0)
invoke  glVertex3f, CFLT(-1.0), CFLT(-1.0), CFLT(0.0)
invoke  glVertex3f, CFLT(1.0), CFLT(-1.0), CFLT(0.0)
invoke  glVertex3f, CFLT(1.0), CFLT(1.0), CFLT(0.0)
invoke  glEnd


I may get the hang of this.

Later all,

Jeff C
:eek

[attachment deleted by admin]
Any good programmer knows, every large and/or small job, is equally large, to the programmer!