Jump to content
  • Advertisement

Archived

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

cippyboy

Bullet Mark

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

I`m trying to make a Shoting system(almost done) and i`m having dificulties making the BulletMark(you know : the "hole" it leaves on the ground...) Actually what I need is to make a small quad out of a plane normal/triangle ... So far I have the planes normal and I`m usaing some strafing function to make2 points on the 2 sides and rotate them on 1 axis to make a small quad. The thing is that my code makes different sizes of quads based on the plane/surface wich sucks,what I would like is a simple functions/anything that can make from 1 plane/triangle at a point P a small quad ||(paralel) to the plane . PS:It can also be used to spill blood .

Share this post


Link to post
Share on other sites
Advertisement
I''ve never actually done decals before but this is the way I think you would do it.

#1 Decide which face you have hit
#2 Get that face''s normal, we can call this vector n
#3 Randomly grab two points belonging to the face and create a vector between them. This will be vector v1. Normalize v1.
#4 Perform a cross product between v1 and n to get v2. This will give you the second vector you need, which will be perpendicular to the face normal.
#5 Scale the vectors v1 and v2 to your desired size of the decal.
#5 Create the quad using v1 and v2

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!