• Advertisement

Archived

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

A quick collision response question...

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

In (almost) every collision response tutorial I've seen, the algorithm presented requires that both the normal and velocity vector are normalized, and I fail to see why. The correct velocity vector (after the collision) can be found without normalizing the vectors: In pseudocode: variable_k = -2 * (V1.x * VN.x + V1.y * VN.y + V1.z * VN.z) / (VN.x * VN.x + VN.y * VN.y + VN.z * VN.z) V2.x = (V1.x + (variable_k * VN.x)) * factor V2.y = (V1.y + (variable_k * VN.y)) * factor V2.z = (V1.z + (variable_k * VN.z)) * factor with V1 being the velocity vector before the collision, VN the normal vector of the surface the particle is colliding with, V2 the velocity vector after the collision and "factor" the coefficient of restitution. The only assumption is that V1 and VN have a length other than 0. So I ask, why waste the time normalizing the vectors? Normalizing the normal vector may have it's uses in other things (lighting, etc...) and if it's precalculated the method described above becomes even faster: variable_k = -2 * (V1.x * VN.x + V1.y * VN.y + V1.z * VN.z) So that leaves me the question: why normalize the initial velocity vector? I've thought about this and haven't yet found a reason to do so. [edited by - Dathomir on April 11, 2004 9:19:51 AM] [edited by - Dathomir on April 11, 2004 9:20:37 AM]

Share this post


Link to post
Share on other sites
Advertisement
velocity vectors are never nornmalised. you can, but it''s a waste usually. Although the collision normal should be normalised in most cases, but sometimes, you don''t have too, like in your example. I''m not usre which examples you refer too, but the examples are either too complicated for their own good (normalising because ...bla bla bla... finding the angle of incidence ... bla bla bla...), or you misunderstood the example.

Share this post


Link to post
Share on other sites

  • Advertisement