Welcome to Dream.In.Code
Become an Expert!

Join 149,505 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,328 people online right now. Registration is fast and FREE... Join Now!




clamping a quaternion camera

 
Reply to this topicStart new topic

clamping a quaternion camera

R3DLIN3
8 Aug, 2007 - 07:47 AM
Post #1

New D.I.C Head
*

Joined: 8 Aug, 2007
Posts: 2


My Contributions
Hello eveyone,

I am using a quaternion for a game where the player can fly around and rotate on all axis, x,y,and z. The problem that I am having is that I want to restrict the rotation on all axis so that the player can never go upside down.


here is the code that I am using to rotate the player
CODE

Quaternion additionalRot = Quaternion.CreateFromAxisAngle(new Vector3(0, 0, 1), yRot) * Quaternion.CreateFromAxisAngle(new Vector3(0, 1, 0), turnRot) * Quaternion.CreateFromAxisAngle(new Vector3(1, 0, 0), xRot);
            player.avatarRotation *= additionalRot;
[quote]

thanks in advance
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 06:56PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month