Forum

Rotate object on itself axis.

29 July 2017 04:50
Have a look at the example given with the get_rotation() documentation.

And also the get_tanslation() function.

var m_scenes = require("scenes");
var m_trans = require("transform");
var m_vec3 = require("vec3");
// precache 3D vector
var _vec3_tmp = m_vec3.create();
// ...
var cube = m_scenes.get_object_by_name("Cube");
var translation = m_trans.get_translation(cube, _vec3_tmp);


It is helpful if you include any errors you see in the browser console.
01 August 2017 12:01
Hi, Will. Thank you for you reply.

I have been did read this examples and I am understand how it is work.

I can't understand, what is the quaternions. I cant what is the x, y, z and w coefficients. I can understand x, y, z. But this quternions really not understandable.

Do you download my example file and run it? If not, please open it. You can understand, what is happen when I click an object and this object is rotating not normal physics. Because it is quaternions.

Thanks.
01 August 2017 19:21
The easy way to do quats is to 'get' a quat from one object and 'apply' it to another. But to understand quats, maybe you can find some videos in your native language. I learned how to use them on YouTube.
02 August 2017 10:01
Thank you,

I am using what you wrote to me. This is work, If your character position is not moved, and rotation is not more over 90 degree.

Thanks.
 
Please register or log in to leave a reply.