Jump to content

BVH Coordinate Euler to Unigine Quat


photo

Recommended Posts

Posted

Hi,

How can I transfer a vec3(angleX, angleY, angleX) in BVH coordinate system to Unigine quat?

Thanks

Posted (edited)

sorry, maybe I didn't say it clearly.

Now I have a Euler data got from BVH coordinate system , Y:up,  X:right Z:forward

 

the data was received from another device, not directly from Unigine

Now in Unigine, I want to use this data, and I need to transfer it to Unigine Coordinate quat

The link you showed me, works for vec3() that comes from the Unigine Coordinate system

In my case, it seems that I need to do some transformation from BVH coordinate system to Unigine Coordinate system.

after that, I can use quat you showed to me.

 

Edited by de-Roo.Lukas
Posted

Hi Lukas,

Per the Biovision format, the order of rotation is Y,X,Z

So I guess you can get the equivalent quat by multiplying the 3 rotation: quatbhv = quat(0,1,0,y)*quat(1,0,0,x)*quat(0,0,1,z)

(or maybe reverse the order, you'll have to check yourself).

Hope this helps.

Posted

Thanks, Amerio

in your solution: quatbhv = quat(0,1,0,y)*quat(1,0,0,x)*quat(0,0,1,z), 

y is for the Y axis in Unigine X is for the X axis in Unigine

however, the angleX,angle Y angleZ now I have, are all from BHV coordinate system, it is not the angle X for Unigine x axis. ,or angleY for Unigine Y axis.

and  I just do not know who to convert angleX in BHV x axis to "angleX" in Unigine x axis.

Posted (edited)
19 hours ago, silent said:

Hi Lukas,

Default quat constructor from vec3 is not working in your case? https://developer.unigine.com/en/docs/2.7.2/api/library/math/class.quat?rlang=cpp&words=quat#quat_constvec3

Hi, silent

I have a set of Euler angles rotation from BVH coordinate system

just as the followings:

AngleX, AngleY and AngleZ in the following coordinate system

1.jpg.9c217ab406976e32a48cc6f0f326a298.jpg

all I current have are three numbers, which got from other device

how should I convert the rotation Euler numbers to Unigine quat?

I don't think quat(AngleX,AngleY,AngleZ) works, as it is for the Unigine coordinate system, right?

 

Edited by de-Roo.Lukas
Posted

Hi Lukas,

Depends on what is the actual axes in your case you might need to change the X Y Z and play with +/- signs in order to get the correct results. Here is some useful links:

  1. https://stackoverflow.com/questions/16099979/can-i-switch-x-y-z-in-a-quaternion
  2. https://gamedev.stackexchange.com/questions/129204/switch-axes-and-handedness-of-a-quaternion
  3. https://math.stackexchange.com/questions/2379468/swapping-quaternion-x-and-z-values

UNIGINE's coordinate system is described here: https://developer.unigine.com/en/docs/2.7.2/start/programmer/basics_objects (basically it's right-handed Cartesian ).

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

×
×
  • Create New...