Closed Arsakes closed 8 years ago
setRotation
is usually called fromTo
in other math libraries. It computes the rotation needed to rotate the first vector to be parallel to the second vector. This is useful if you have a camera looking in direction a and want to rotate it to look in direction b for example.
In your example rot0
will be multiplied with rot1
and then the camera's orientation will be set to the result of that multiplication (which will be a new XML3DRotation object). The multiplication order is the same as the text order, so rot0 * rot1
.
The manual says that function
XML3DRotation.setRotation
does following thing.How one should understand that? How the rotation is computed from those two vectors?
Also could you clarify how multiply function works on example - i'm getting some unexpected results with this. (That is the rotations are performed in different order that I get from text): Lets say i have following code:
Which rotation affects the camera first?