de-Roo.Lukas Posted September 17, 2018 Posted September 17, 2018 Hi, How can I transfer a vec3(angleX, angleY, angleX) in BVH coordinate system to Unigine quat? Thanks
silent Posted September 17, 2018 Posted September 17, 2018 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 How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
de-Roo.Lukas Posted September 17, 2018 Author Posted September 17, 2018 (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 September 17, 2018 by de-Roo.Lukas
Amerio.Stephane Posted September 17, 2018 Posted September 17, 2018 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.
de-Roo.Lukas Posted September 17, 2018 Author Posted September 17, 2018 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.
de-Roo.Lukas Posted September 18, 2018 Author Posted September 18, 2018 (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 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 September 18, 2018 by de-Roo.Lukas
silent Posted September 18, 2018 Posted September 18, 2018 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: https://stackoverflow.com/questions/16099979/can-i-switch-x-y-z-in-a-quaternion https://gamedev.stackexchange.com/questions/129204/switch-axes-and-handedness-of-a-quaternion 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: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
Recommended Posts