Sign in to follow this  

trying to figure out reflextion calutaions?

This topic is 2296 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
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 [url="http://www.google.ca/search?q=vector%20reflection"]Google[/url], or even on [url="http://www.gamedev.net/topic/165537-2d-vector-reflection-/"]this very site[/url]!

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

Share this post


Link to post
Share on other sites
[quote name='Dunge' timestamp='1317856575' post='4869592']
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 [url="http://www.google.ca/search?q=vector%20reflection"]Google[/url], or even on [url="http://www.gamedev.net/topic/165537-2d-vector-reflection-/"]this very site[/url]!

Vect2 = Vect1 - 2 * WallN * (WallN DOT Vect1)
[/quote]

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