opengl - Cylinder Normals -


i'm developing opengl application right draws big tube consisting of several small cylinders (kind of slinky). i'm getting annoying effect when turn lighting , normals on, angles these annoying black dots on cylinders' borders:

black dots on individual cylinders borders

i belive byproduct of fact cylinders thin. set normal (0,0,+/- 1) when setting top/base, , side normals (cos(toradian(beta)), sin(toradian(beta)), 0).

is possible remove effect whitout getting 'fatter' cylinders? or there wrong in way define normals?

thanks

this appears rendering of sides of cylinders. yellow in image corresponds tops of cylinders. sides of cylinders @ 90 degrees tops, not lit (i'm guessing light in same direction camera) , appear black. cylinders being thin these not fill make pixels don't show much.

how fix it? i've got couple of ideas:

1) draw tops , bottoms, not sides - fix problem when viewed angle, lead further problems if camera moves.

2) disable lighting, faces drawn same colour (assuming sides same colour top).

3) use multi-sampling - means of edges won't appear (as each pixel more top side due angle).

4) add more lights around scene, perpendicular current light.

1 & 2 best bet depending on you're trying achieve.


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -