question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How does object.rotation work?

See original GitHub issue

Hi,

I’m trying understand how work rotations property on objects. I need to do a lot of rotations, but when i do the first rotations i dont understand the behavior of the next rotations.

this.de2ra = function(degree)   { return degree*(Math.PI/180); }

This work ok alone:

this.cube.rotation.y = this.de2ra(90);

and this too:

this.cube.rotation.x = this.de2ra(45);

but if i do this:

this.cube.rotation.y = this.de2ra(90);
this.cube.rotation.x = this.de2ra(45);

if the exactly the same of this:

this.cube.rotation.y = this.de2ra(90);
this.cube.rotation.z = this.de2ra(45);

Anyone can explain me why work like that? Ty all, and sorry for my english.

Issue Analytics

  • State:closed
  • Created 11 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
WestLangleycommented, Jun 19, 2012

Rotations occur in the order specified by object.eulerOrder, not in the order you specify them.

The default Euler order is ‘XYZ’, so rotations are by default performed in the order X-first, then Y, then Z.

Rotations are performed with respect to the oject’s internal coordinate system – not the world coordinate system. So, for example, after the X-rotation occurs, the object’s Y- and Z- axes will generally no longer be aligned with the world axes.

1reaction
Pennswoodcommented, Oct 4, 2016

So if I want to rotate with regards to world coordinate, must I do some really hard math regarding to Quaternion and stuff, or is there some command to just rotate on world coordinate, cause that is some pain in the neck.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chapter 1 Rotation of an Object About a Fixed Axis
Figure 1.1: A point on the rotating object is located a distance r from the axis; as the object rotates through an angle...
Read more >
When and why do objects rotate? - Quora
Gyros are wheels. A rotating object has angular momentum. If the wheel increases or decreases its angular momentum in one direction, to conserve...
Read more >
rotation | National Geographic Society
Rotation describes the circular motion of an object around its center. There are different ways things can rotate.
Read more >
How to Rotate in Unity (complete beginner's guide)
Rotation in Unity typically works by specifying an amount of rotation in degrees around the X, Y or Z axis of an object....
Read more >
5.4: Dynamics of Rotating Objects - Physics LibreTexts
We will work both problems in parallel, to make the difference more evident. Start with mechanical energy conservation from the top of the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found