Skip to main content
gamedev.net
🔒 Locked 🎲 GameMaker

Collision response

Started by jamwaffles 3 replies 950+ views
Original Post
jamwaffles
jamwaffles
Hi all

I am writing a game and have got to the part where I need to do collision response. I can rotate the object using matricies, I can find the point where a ray intersects a triangle, however I now need to work out what to do with the object after it's collided. I have read the tutorial at http://www.gamasutra.com/view/feature/3427/collision_response_bouncy_.php?page=2 and I am attempting to implement the maths at the bottom of that page.

However, I'm stuck on one point... it tells me to do this

((N.V) * N)

Now N and V are vectors, and the dot (.) product of N and V is obviously a number. How can I multiply a number by a vector (N)?

Any help would be much appreciated,

Thanks for reading,

James

EDIT: PS. what's the tag for inserting URLs in; I tried [url][/url] and that didn't work. What am I missing?
http://www.jamwaffles.co.uk - my site - new look, faster loading, free wallpapers, tutorials and other pointless crap.
Ron AF Greve
Ron AF Greve
Just mutliply all elements of the vector by the number.

Note that what you do here is project V on N and let the result have the direction of N (assuming N is unit vector).
Ron AF Greve
jamwaffles
jamwaffles
So...
N.x * (N.V)
N.y * (N.V)
N.z * (N.V)
?

Thanks very much :)

James
http://www.jamwaffles.co.uk - my site - new look, faster loading, free wallpapers, tutorials and other pointless crap.
jamwaffles
jamwaffles
Quote:
Original post by Ron AF Greve
Exactly :-)


Thankyee good sir :P
http://www.jamwaffles.co.uk - my site - new look, faster loading, free wallpapers, tutorials and other pointless crap.

Topic Locked

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

Sign in to reply to this topic.