How to rotate a object without changing the axis by SIO2?

View previous topic View next topic Go down

How to rotate a object without changing the axis by SIO2?

Post  Ubicomp on Wed Jul 22, 2009 4:51 am

I am now doing a project requiring to rotate a cube freely in X, Y, and Z direction,
but I found that while X and Y axis will chenge when retating the cube, the Z axis will always points to the same direction,
whitch in resault causing a lot of problems.

Is there any posibility that I can fix all the three axises( x, y, z) while rotating by a cube?

Ubicomp

Posts : 7
Join date : 2009-07-22

View user profile

Back to top Go down

Re: How to rotate a object without changing the axis by SIO2?

Post  sio2interactive on Wed Jul 22, 2009 4:14 pm

A bit of linear algebra will do the trick Wink

_________________
SIO2 Interactive
Free Open Source 3D Game Engine for iPhone and iPod Touch
http://sio2interactive.com
avatar
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 37
Location : Shanghai

View user profile http://sio2interactive.com

Back to top Go down

Re: How to rotate a object without changing the axis by SIO2?

Post  Ubicomp on Thu Jul 23, 2009 3:29 am

Sorry, I still can't really get the picture.
I look throw some .h files of SIO2, and I noticed that the rotation in SIO2 is implemented by "Euler angles" ( please let me know if it is not correct), which can cause "Gimbal Lock", and "Gimbal Lock" is also a problem that I faced.
So is there a solution really requiring "a little linear algebra" that can fix my problem?

Ubicomp

Posts : 7
Join date : 2009-07-22

View user profile

Back to top Go down

Re: How to rotate a object without changing the axis by SIO2?

Post  zzajin on Thu Jul 23, 2009 9:25 am

Maybe sio is referring to quaternions?

http://www.flipcode.com/documents/matrfaq.html#Q35

zzajin

Posts : 81
Join date : 2008-10-14

View user profile

Back to top Go down

Re: How to rotate a object without changing the axis by SIO2?

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum