Advertisement

How do you find a vertecies new pos after you rotate an object

Started by September 07, 2002 08:17 PM
2 comments, last by crossbow 22 years, 5 months ago
I am making a space sim game, and I have a little torpedo firing routine, but I need to be able to fire the torpedo from the correct spot on the ship, which is at the front of it. I have a ship model and everything, and the torpedo function works, but how do I find where to set the starting position of the torpedo when I fire it? I use quaternions for all my rotations, and I have the view vector and axis vectors.
look at the model without transformations and see where the torpedo comes out...record this position and call it v. when you rotate the object using some quarternion q , also rotate vector v using q. Same thing for any translations etc. that you might do.
Advertisement
I''m not sure how to do that. Can you be more specific? Like how do I rotate a vector around a centerpoint with a quaternion?
There are any number of tutorials on object rotations, including several on this site. Please look through the Articles & Resources link (at the top of this page). You may find something useful there.

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net

This topic is closed to new replies.

Advertisement