The document said:
Each mesh in the scene also has its own Local Space.
Meshes are created with their local space origin at the world space origin and with their local space x, y and z axes aligned with the x, y and z axes of the world space.
Is there a way to change the default xyz axes alignment between local space and world space?
I mean, when I create a new mesh, I want to change the mesh Local Space xyz axes rotation some value (such as Math.PI / 4) relative to the world space.
so, I can move the mesh along the Local Space xyz axes, such as:
// the value 2 is along the `Local Space` X axis (that has rotate Math.PI / 4 to world space X axis).
mesh.position.x += 2;
You can move the mesh relative to the local axes using, mesh.translate, mesh.setPositionWithLocalVector, and mesh.locallyTranslate as described further down on the page you quoted from
Do you mean set new axes on a mesh independently of the current mesh axes?
Yes:
I need to move/rotation the mesh along the given axes instead of the default local axes.
Can you give your use case for this?
Yes:
Imagine you have many meshes on a circle, and need to move the mesh along the radius or along the tangent.
My case it’s more complex than this (it’s not on a circle, on Irregular curve load from stl file)
Take one mesh as example:
I have the mesh center
I have the move values (x,y,z) and rotation values (alpha, beta, gamma)
I can compute the move / rotation directions (axis1, axis2, axis3)
I need to do the compute many times on give move/rotation data array
=====
I think for this issue there are two ways:
Transform the move values (x,y,z) and rotation values to default local axes
use my own move / rotation directions (axis1, axis2, axis3)
#1 is the general way, but I do not know how to compute, is there an example for this.
so, I ask this question for #2 method, you said:
“rotation about these axes is possible but a lot trickier to work out”
may you help to make an example like position transform?