The MASM Forum Archive 2004 to 2012

Project Support Forums => OpenGL Forum => Topic started by: OceanJeff32 on September 30, 2005, 01:50:04 AM

Title: Ok, so I tried something new.
Post by: OceanJeff32 on September 30, 2005, 01:50:04 AM
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]
Title: Re: Ok, so I tried something new.
Post by: hitchhikr on September 30, 2005, 08:14:56 AM
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.
Title: Re: Ok, so I tried something new.
Post by: OceanJeff32 on October 01, 2005, 12:30:21 AM
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]