The point and the axis together define the line that the mesh will rotate about.
Rotate Around works like this, in world space:
From the current position of the mesh imagine a line that meets, and is perpendicular to, the line defined by the point and the axis. The place where they meet will be the center of rotation and the rotation will take place in a plane that passes through the mesh position and whose normal is the axis.
Have fun trying out any vector for the position of the point and any vector to replace the BABYLON.Axis.X vector.
Well of course! Adding a parent has changed the frame of reference. The world space of the pilot is now its parent local space.
Scaling the TransformNode by 0.5 means that the point (8, 1, 1) in the now world space of the pilot becomes the point (4, 0.5, 0,5) in Babylon world space and the marker and line have to be adjusted accordingly to draw them in the Babylon world space.
Rotates the mesh around the axis vector for the passed angle (amount) expressed in radians, in world space.
Should be
Rotates the mesh around the line defined by the point and axis vector for the passed angle (amount) expressed in radians, in the plane determined using the axis as the plane normal and the position of the mesh as a point on the plane in the frame of reference used to describe the point, axis and mesh position .
I think generally that any description for any object within the API that uses the phrase ‘world space’ means that the object position, rotation and scale is in Babylon world space and any action and vector parameters are in that space also. The change of frame of reference by the use of parents or any other means on the object means that the user needs to consider that the working space for the object has changed.
OK… I get it now. We just don’t agree on the meaning of “world space”
The way I learned 3D, and the way i’ve seen it applied in every other engines : the term “world space” has a meaning : it’s the main frame of reference, the one in which all other are expressed by matrix composition. It is shared by all objects.
I’m guessing it’s what babylon calls “absolute coordinates”.
When you say : “The world space of the pilot is now its parent local space.” I simply disagree on a sementic level.
Anyway, I now have my answer. It’s a semantic problem and not a mathematical one.
However, one last playground with a behavior I don’t realy understand.
Using the same parenting as before, but changing rotation and position of the parent, NOT scale, will keep the rotation working properly. Based on what you just said, It should not.
Please note in your PG #63 in lines 26 to 31 you use X, Y, Z rather than x, y, z and so they have no affect on the results.
I would say that is what is meant by world space in the comment Rotates the mesh around the axis vector for the passed angle (amount) expressed in radians, in world space.
It is when you add a parent to the mesh things change.
You are correct and unless we agree on terminology there will always be confusion. In the end it all comes down to the coding used for the rotateAbout method. All I am doing is examining what happens in the various situations you are stating and trying to describe what happens and how and why the actions are what they are. There are multiple frames of reference being used and really we need to define and be clear about each of them.
Frame of reference 1, the, as you say, the main frame of reference the world space
Frame of reference 2, the object local space, usually on creation of an object the local space origin is the world space position of the object and local axes directions match those of the world space
Frame of reference 3, the object-world space with origin the world space position of the object and object-world axes matching the world space axes
So it looks like when you add a transform node as a parent the rotateAbout is applied in frame of reference 3
This PG applies not rotation to the transform node only a translation and only a translation is applied to the marker point and the line https://playground.babylonjs.com/#Z3W74Y#64
What happens if the transform node is translated and rotated https://playground.babylonjs.com/#Z3W74Y#65 ? You are right in that rotateAbout is taking place in frame of reference 3 the object-world space
My statement should be amended to
Well of course! Adding a parent has changed the frame of reference. The frame of reference of the pilot is now the parent_world space.
Which in many ways makes the API more reflective of the situation. Rx