Archived

This topic is now archived and is closed to further replies.

Poya

Polygon Splitting = Float Imprecision ?

Recommended Posts

Poya    123
Hi I have been working on a leafy BSP. It''s all working very well except that when I run through the level I can see very tiny holes where the back-ground color is showing. They are very small and when you walk through the level different ones pop up. Sort of like an old grainy film. The holes seem to pop around distinctive lines which I assume to be where the polygons are splitted in the BSP. The only conclusion I can come up with is that this is some sort of float precision issue. I don''t see why though, since the polygon splitting function assigns the exact same coordinates along the splitting plane to the right and left polygons. I checked them manually by outputting the splitted polygons'' coordinates to the console, and the shared edges have identical vertex positions. So I really don''t see why I''m getting tiny gaps in the level. Has anyone ran into a similar problem or can guess why this is happening and how I could possibly fix it? Thanks in advance, Poya

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
might be a "crossing the T" problem which is a floating point
precision problem that occurs where two meshes join or where
wall meets floor and the vertices of the triangles dont match up.

| polygon 1 \
| \
-------------------------
| /|\ |
| p2 / | \ p3 |
| / | \ |
| / p4| p5\ |

a seem may show up along the bottom of polygon 1.

to fix the above problem you need to break polygon 1 up into
2 or three additional triangles that use the vertex in the
middle.


Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
well that didnt quite show up the way i had intended..

|.................\
|....polygon1......\
|...................\
---------X-----------
|......./|\.........|
|..p2../.|.\....p3..|
|...../..|..\.......|

Share this post


Link to post
Share on other sites
Poya    123
as far as I understand GL_CLAMP, GL_CLAMP_TO_EDGE are related to texturing and so would not effect my situation. btw I''m using Direct3D. There is a render flag, D3DRS_LASTPIXEL which is supposed to turn on/off the last pixel in a triangle. I set it to both TRUE and FALSE, but it didn''t change anything.

Ummm, Mr. Anonymous Poster Could you give me a bit more detail about this "crossing the T" problem? perhaps a web link? I tried searching for it on google but had no luck.

Thanks

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
its basically where youve got meshes that vertices dont
line up with each other.

think of what its called.."crossing the T"

envision the top line of the T being an edge of a
triangle or quad in your scene..if youve any quads
or triangles that have a vertex along that edge,
youve just crossed the T and a seem will likely appear.

hopefully that made sense..its so much easier showing it
graphically.



Share this post


Link to post
Share on other sites