Skip to main content
gamedev.net
🔒 Locked

3d reflection

Started by dan parker 1 reply 350+ views
Original Post
dan parker
dan parker
hi, thisis should be real easy to do, but for some reason I cant ge t it to work and its driving me mad! i want to work out the angle of reflection of a ball hitting a flat surface, not taking into account gravity etc.. i have so far tried this, but it doesnt work :0( newDir = oldDir - (planeNorm * (oldDir.dot(planeNorm))*2); anyone offer any help?
gumby
gumby
Actually, that looks pretty good.


Is planenormal a unit vector?

[edited by - gumby on March 4, 2003 1:55:16 PM]
dan parker
dan parker
yep! they be normalised!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.