#### Archived

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

# Polygon Splitting = Float Imprecision ?

This topic is 5743 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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 on other sites
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 on other sites
well that didnt quite show up the way i had intended..

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

##### Share on other sites
dammit!! stinkin ascii reformatting!!

##### Share on other sites
Look up GL_CLAMP and GL_CLAMP_TO_EDGE.

##### Share on other sites
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.

Thanks

##### Share on other sites
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
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.

1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5

• 15
• 13
• 9
• 12
• 10
• ### Forum Statistics

• Total Topics
631442
• Total Posts
3000085
×