Problem with GL

Questions or HOWTOs about the above? Post 'em here...
Post Reply
User avatar
Skeeve
Private First Class
Private First Class
Posts: 122
Joined: Sun Jun 04, 2006 3:27 pm
Location: Near Aix La Chappel

Problem with GL

Post by Skeeve »

I have a problem with this http://rafb.net/p/34gzzJ89.html

The // doesn't work part should draw a box from the center (glsYc) up to the calculated size if it's positive, and down, if the size is negative. So the vertices are:

Code: Select all

4   3

1   2 - center here
The positive part works, the negative not, i.e. no box is drawn when the vertices are:

Code: Select all

1   2 - center here

4   3
If I start the box not in the center but at the bottom, it increases in size when the calculation gives positive values

Code: Select all

4   3

      - center here


1   2 - bottom
and shrinks for negative ones

Code: Select all

      - center here

4   3

1   2 - bottom
I have no idea why this happens. Can anyone enlighten me please?
Avatar created with South Park Studio

Don't you hate it when your posts get deleted without any note?
User avatar
Guided Monkey
Private First Class
Private First Class
Posts: 8
Joined: Sun Jan 11, 2004 11:34 pm

Post by Guided Monkey »

I'm much too lazy to see if this is true or even relevant, but if OpenGL uses a right-handed coordinate system, then your second set of vertices defines a quad with the normal facing into the screen. If these quads are not two-sided, then you won't see anything if the normal doesn't point out of the screen.

Like I said, it's just a guess and I am too lazy to look it up.
User avatar
Skeeve
Private First Class
Private First Class
Posts: 122
Joined: Sun Jun 04, 2006 3:27 pm
Location: Near Aix La Chappel

Post by Skeeve »

Sounds logical to me, Money. And it fits to my observation that the bar can be seen if I order the vertices.

Thanks!
Avatar created with South Park Studio

Don't you hate it when your posts get deleted without any note?
Post Reply