### Tags: angles, anglesgt, conversion, euler, input, jacob, matlab, programming, quaternions, rotation

# Conversion of euler angles to quaternions to use for rotation

On Programmer » Matlab

2,016 words with 0 Comments; publish: Wed, 30 Apr 2008 17:17:00 GMT; (200265.63, « »)

Hello Jacob,

> Can anyone tell me how to make the right conversion from euler angles

> to the right quaternions used as input to the VR-model'

VRML97 language, used by Virtual Reality Toolbox, doesn't define object

rotations with quaternions, but in the [axis_of_rotation angle] form.

There are basically 2 ways how to get Euler angles into VR model, you

can choose which one is suitable for you:

1.

Wrap your original Helicopter body in the VRML model by 3 additional

nested transforms as in the example at the end of this message. Then you

can send individual Yaw, Roll and Pitch angles to these Transforms -

controlling them independently - VRML creates the compound object

rotation for you. Note defining the different initial rotation vectors

in these 3 transforms - this allows you to use the "VR Expander" block

conveniently - see VR Toolbox documentation and soem examples, eg.

"vrcrane_traj"

2.

You can create a compound rotation from 3 Euler angles or DCT matrix

which is also available in the 6-DoF block. For this you need a

conversion function / block. I am sending to you a Simulink library file

containing Rotation Matrix to Axis/Angle conversion block, that will be

in the Virtual Reality Toolbox in few months.

Hope this helps, good luck!

Jan

DEF Parts_rot_yaw Transform {

rotation 0 1 0 0

children [

DEF Parts_rot_pitch Transform {

rotation 1 0 0 0

children [

DEF Parts_rot_roll Transform {

rotation 0 0 1 0

children [

DEF Heli_Body Transform {

children [

# Helicopter body

]

}

]

}

]

}

]

}

--

---

Jan Danek

danek.matlab.todaysummary.com.humusoft.com http://www.humusoft.com

--

HUMUSOFT s.r.o., Pobrezni 20, 186 00 Praha, Czech Republic

Tel: +420 2 84011730 Direct Tel: +420 2 84011746

Fax: +420 2 84011740

---

*http://matlab.todaysummary.com/q_matlab_10151.html*

All Comments

Leave a comment...

- 0 Comments