Sign in to follow this  

Limiting a Quaternion/Matrix

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

Two questions about limiting quaternions. Question #1: I have a routine that can calculate a rotation matrix (and from there a Quaternion), so that I can make an object face another object. From this I can create a turret that will turn and face a target. However, this turret should not be able to turn as fast as it wants. How do I limit a matrix/quaternion so that it can only turn X deg/sec? Question #2: No turret can turn to any location on any axis. How do I limit the above matrix/quaternion so that it can only rotate on a single axis? Or even a part of an axis? As an example, picture a battleship. the turrets on the ship should be able to swing +90 to -90 from the front of the ship, and 0 to 45 in elevation, and do that rather slowly. This is the math I'm trying to figure out.

Share this post


Link to post
Share on other sites
If you are trying to implement fixed-axis objects like turrets, consider using local Euler angles. Their usual annoyances are exactly what you want in this instance, and adjusting the yaw and elevation separately is easy and realistic. You can just clamp the yaw and elevation values then.

Share this post


Link to post
Share on other sites

This topic is 3231 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this