Jump to content
  • Advertisement
Sign in to follow this  
thedodgeruk

trying to figure out reflextion calutaions?

This topic is 2631 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

if i have a bullet with a facing vector of 0,0,1 and a metal wall at 0.7, 0.7, 0.7, ( think thats about right for a acing vectorX for a wall at 45 degrees, , i would like to figure out the calulations of the bullet as it bounces off it ,

like a ball hiting a wall , can any one point me in the right direction for this bit of maths

Share this post


Link to post
Share on other sites
Advertisement
Sorry to be a grammar nazi, but please review your post before posting it. Look like you wrote this in under a few seconds with so many grammatical errors in there.
Also this seems like a school homework so you won't have the direct answer.

Anyhow, your "wall" is a surface, or a plane, composed of a normal (vector pointing "outside"). Your bullet direction is another vector ((0,0,1) means the Z axis, not the X). There's an easy formula to get the reflection vector from the two variables that can be found using a 2sec search on Google, or even on this very site!

Vect2 = Vect1 - 2 * WallN * (WallN DOT Vect1)

Share this post


Link to post
Share on other sites

Sorry to be a grammar nazi, but please review your post before posting it. Look like you wrote this in under a few seconds with so many grammatical errors in there.
Also this seems like a school homework so you won't have the direct answer.

Anyhow, your "wall" is a surface, or a plane, composed of a normal (vector pointing "outside"). Your bullet direction is another vector ((0,0,1) means the Z axis, not the X). There's an easy formula to get the reflection vector from the two variables that can be found using a 2sec search on Google, or even on this very site!

Vect2 = Vect1 - 2 * WallN * (WallN DOT Vect1)


sorry im dyslexic , and surprisingly its not a school project , its part of a uni game engine that im doing lol

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!