View unanswered posts | View active topics It is currently Sun Jan 20, 2019 5:22 am

Reply to topic  [ 1 post ] 
 Need Help with quaternions in libogc 
Author Message

Joined: Sun Sep 13, 2009 6:37 pm
Posts: 9
Location: St Louis, MO USA
I am trying to use quaternions and they do not appear to be working for me (Its probably me).

Here is some of the code that I am trying and its not giving me the results that I was expecting and I don't really know how to troubleshoot this.

   c_guMtxQuat(q, &cubeQuat);

        guVector axis = {0,1,0};
   guMtxRotAxisDeg(QuatMatrix, &axis, rot);
   // MtxQuat should take a matrix and turn it into a quat
   c_guMtxQuat(QuatMatrix, &cubeQuat);

        c_guQuatMtx(&cubeQuat, TempQuatMatrix);

   // Multiply the Rotation (QuatMatrix) with the ModelMatrix into TempModelMatrix
   guMtxConcat(TempQuatMatrix, ModelMatrix, TempModelMatrix);

When I do this, the cube that was in my view, is no longer in my view. If I took out the Quat stuff and just left the RotAxisDeg the cube would be spinning in the view.

If someone has an example that I could read and learn from that would be the best option but I will take any advice/knowledge that anyone has.

Currently doing 3ds game programming!

Fri Feb 06, 2015 3:13 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
  Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.
Get devkitPro at Fast, secure and Free Open Source software downloads