Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vec3 getTransformPositionWithoutMatrix(vec3 _pos,vec3 _rotation){
- //ROTATIONS
- float sx = sin(_rotation.x);
- float cx = cos(_rotation.x);
- float sy = sin(_rotation.y);
- float cy = cos(_rotation.y);
- float sz = sin(_rotation.z);
- float cz = cos(_rotation.z);
- //ROTATION X
- float xy = cx * _pos.y - sx * _pos.z;
- float xz = sx * _pos.y + cx * _pos.z;
- //ROTATION Y
- float yz = cy * xz - sy * _pos.x;
- float yx = sy * xz + cy * _pos.x;
- //ROTATION Z
- float zx = cz*yx - sz*xy;
- float zy = sz*yx + cz*xy;
- _pos.x = zx;
- _pos.y = zy;
- _pos.z = yz;
- return _pos;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement