Jump to content
  • Advertisement
Sign in to follow this  
nullsquared

Transforming linear/rot. vel. in accordance to a surface?

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

I had a previous post like this, for positions... (here, there're some details that still apply here) Now, I can't get something to work for linear and rotation velocity. I have an object, O, which is moving at a velocity of V (in world space). Now, I want to take V, and transform it so that it's relative to an object, B, by its rotation and position, the way it's relative to another object, A, by its rotation and position. How do I do this? Also, for O, I have a rotation velocity. How do I do the above, but for the rotation velocity? (Which is relative to O itself, not in world space...) Thanks a bunch! [smile] My rotations are represented via quaternions and my positions via 3D vectors... I can convert back and forth to matrices if needed, though. (I've tried doing the same thing as in my other post for positions, but it had VERY strange results... I'm guessing it's just not the same, since velocity is a direction and magnitude [all together in a 3D vector], not just a position) [Edited by - agi_shi on November 4, 2007 9:34:50 AM]

Share this post


Link to post
Share on other sites
Advertisement
VA -= VB + VO where VB -= VO.

As far as relative rotation, you might not need to want to. Even so, what axis of rotation do you want for A? Does it rotate around B? O? Origin?

Share this post


Link to post
Share on other sites
Quote:
Original post by erissian
VA -= VB + VO where VB -= VO.

As far as relative rotation, you might not need to want to. Even so, what axis of rotation do you want for A? Does it rotate around B? O? Origin?


Hm. Thanks for the reply! However - from what I understand, that won't take the orientations of the objects into account... (I realize my OP was a bit unclear, I fixed it)

Share this post


Link to post
Share on other sites
What won't take orientation into account? The velocity defines only the direction the object is moving, and how quickly. Did you mean the rotations? We haven't got to those yet.

Share this post


Link to post
Share on other sites
Quote:
Original post by erissian
What won't take orientation into account? The velocity defines only the direction the object is moving, and how quickly. Did you mean the rotations? We haven't got to those yet.


I know. What I'm saying, is that I want to take V, and make it relative to B, the way it is relative to A (by their orientation/position, not how it's relative to their velocities).



That's a 2D representation of what I want... Basically, V is going somewhere, I then take it's relativity to A, and make it relative to B the same way, resulting in V'.

I'm not quite sure how to explain it better... thanks for your replies so far, though [smile]

Share this post


Link to post
Share on other sites
Ok, let's do it this way: You're trying to get help with a method to do something. Why don't you tell me what that something is? That way I won't have to guess what you mean.

Share this post


Link to post
Share on other sites
Quote:
Original post by erissian
Ok, let's do it this way: You're trying to get help with a method to do something. Why don't you tell me what that something is? That way I won't have to guess what you mean.


Quote:
I want to take V, and make it relative to B, the way it is relative to A (by their orientation/position, not how it's relative to their velocities)


Not sure how much better I can explain it. Does the picture not help a bit? The little arrows on the surfaces show the way the surface is facing.

Look at my other post here, there's the solution to transforming a position. Now I need to do the same, but for a linear velocity (possibly rotational velocity).

Share this post


Link to post
Share on other sites
Yes, I made it work with the previous method!


- translation of matrix = [0]
- rotation of matrix = [something perpendicular, something perpendicular, normalised velocity]
- transform the matrix as previously
- new velocity = z axis of transformed matrix orientation * old magnitude


Crude, but it works. If you guys have more optimized ways [grin], I wouldn't mind [smile]

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!