PDA

View Full Version : quadstripts and normal - howto



OGLguy
02-10-2009, 04:36 PM
My shading for quadstripts does not seem to be right.
It's dark around the corner area where the strips turns 90 degrees.
It looks like averaging notmals at the corner.
Not sure how it calculates the normals of vertex at 90 turn.
I'm using vertex arrays with normals and colors.
The normals I gave were (0,-1,0), (0,-1,0) (1,0,0) for (1), (2)
and (3) as shown below (cross section view).

Thanks.


------------- y
| | ^
| x (3) |
| | |
---------x---x |----> x
(1) (2)

OGLguy
02-10-2009, 04:39 PM
Sorry.
The picture was not displayed properly.
(1) facing -y
(2) corner
(3) facing +x

dletozeun
02-10-2009, 05:07 PM
Very hard to help you with such a poor information... is it possible to have a screenshot?
If it is about normals, try to render them at each vertex using GL_LINES, you will see immediatly if they are correct or not.

Brolingstanz
02-10-2009, 05:21 PM
also there's an inherent ambiguity with quads and shading stemming from strip orientation and/or that of the triangles themselves - 2 possible triangle configurations with strips or lists. You could try using triangle lists instead to nail down the orientation thing, if that's an issue... kinda depends on what you're modeling too.

(fyi, use the code tags to preserve formatting.)