This tutorial provides basic information about JavaFX 3D Coordinate System and Rotation of Stickman3D. In JavaFX, locations are described
with x, y, z coordinates. Increasing coordinates go along the x-axis to the right, along the y-axis downwards, and along the z-axis out of the screen.
See Fugure 1
You can place 3D objects at the point p (0,0,0,) and move them to wherever you want.
Because "Stickman 3D" consists of 3D objects, we can move these objects in 3D like the Figure 2. For this we have to create "Translate" object
in convenient class and add in the relaying object's "Transformation"
An
example of the class HeadFX
TriangleMesh mHeadTriangleMesh;
public MeshView mHeadMeshView;
public Group mHead;
...
url = getClass().getClassLoader().getResource("BodyParts/Head.stl");
im = new StlMeshImporter();
im.read(url);
mHead = new Group();
mHeadTriangleMesh = im.getImport();
...
mHeadMeshView = new MeshView(mHeadTriangleMesh);
mHead.getChildren().add(mHeadMeshView);
...
Translate translation = new Translate(mXTranslation, mYTranslation, mZTranslation);
mHead.getTransforms().clear();
mHead.getTransforms().addAll(translation);
Rotation
"3D-Rotation" is harder in JavaFX. Stickman3D consists of few body parts(for example : DownBody, HeadFX, LeftUpperArm, LeftForeArm, LeftWris...,
which are in Package de.dfki.stickman3D.body). Each body part has it's local coordinates system in 3D-dimension.In order to be the rotation right ,
it is necessary to pay attention to body parts dependence to each other. For example : if we make "LeftUpperArm" rotation , it will cause it's parts transformation
which are in the group. ("LeftForeArm", "LeftWrist", "LeftFinger1...LeftFinger4"), so it's local coordinate system will change.
In order to see , how rotation operates on any part and make it's visualization, we can use "RotationHelper" called "Rotation" in "Control Panel".
Here we can see rotation effect beforehand and X,Y,Z convenient meanings.