Jump to content
  • Advertisement
Sign in to follow this  

Some more advanced questions about quaternions

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

So I'm making a game for the iPhone and I'm retreiving the device orientation as a quaternion. I'm making the device rotation act as a joystick. When you offset the device by some amount from the reference orientation, it acts as a joystick input. It works and it's pretty cool, but it's very hard to use without some good feedback in the HUD.

This picture describes the kind of HUD I'm trying to draw.

I got the dark green device orientation crosshair to draw and roll just fine based on device orientation.

I have a device orientation deadzone so a player isn't just constantly jittering around. I'm not sure what the math would be behind drawing the outer deadzone circle though.

On top of that I also have a roll deadzone which is separate from the look deadzone. As I was playign around I found I was rolling the device a little too easily as I was looking around so I'd want to have a much bigger roll deadzone. I'll try to get around drawing that HUD element later but I might have an idea of how to draw it since you can get the roll component of a quaternion with

[font=Courier New][color=#000080]angle= 2 * acos(w)[/font] when converting to axis angle representation.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!