Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

CML get x y z w value from quaternion object


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Vastark   Members   -  Reputation: 106

Like
0Likes
Like

Posted 27 July 2012 - 06:00 AM

hi every one..
i want to get x y z w value's from a cml::quaternionf object

my code :

cml::quaternionf cmlObjRot = cml::quaternionf(0.5f, 0, 0,0); //make an quaternion object with set x y z w value's

//now i want to get my x y z w i set in upper line code

float x,y,z,w;

float x=cmlObjRot.x ???? // how to get x value from my cmlObjRot object ? i think x value must be 0.5f

thank you.

Edited by Vastark, 27 July 2012 - 06:02 AM.


Ad:

#2 Brother Bob   Moderators   -  Reputation: 4633

Like
1Likes
Like

Posted 27 July 2012 - 06:29 AM

Use operato [] to access the individual components.
float x=cmlObjRot[0];


#3 Vastark   Members   -  Reputation: 106

Like
0Likes
Like

Posted 27 July 2012 - 06:55 AM

Thank you so much Brother Bob.Posted Image
worked !




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS