Archived

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

MagTDK

Bullet decals

Recommended Posts

I''ve been working on adding bullet decals to my project, and so far I''ve been able to get most of it to work. The problem I''m having has to do with knowing when to clip the bullet decal when it''s hanging over an edge. Or when to split the decal so it''s spanning two walls like the corner of a room. Anyone know what''s the best way to go about this? Just so you know I''m using a bsp tree.

Share this post


Link to post
Share on other sites

Since no one has answered, I''ll present what I''ve come up with so far in theory:

1) Send the bullet vector down the bsp tree were it will return the closest intersect point (position in world space) and the leaf the intersection occurred in.

2) Create a bounding box around the decals intersect point. This could also be a bounding sphere.

3) Traverse the bsp again but this time send the decals bounding box down the tree. This will find all possible leaves the decal spans across.

4) Check the decals bounding box against every polygon, in every leaf that was found, for an intersection.

5) If an intersection occurs, clip the decal against that polygon.

Share this post


Link to post
Share on other sites
Check out nates dynamic lighting demo, handles the issues of decaling.

http://nate.scuzzy.net/programming/

~Main

==
Colt "MainRoach" McAnlis
Programmer
www.badheat.com/sinewave

Share this post


Link to post
Share on other sites