use of javafx.scene.transform.Translate in project FXyzLib by Birdasaur.
the class TexturedMesh method updateTransforms.
protected void updateTransforms() {
getTransforms().removeAll(rotateX, rotateY, rotateZ, scale);
Bounds bounds = getBoundsInLocal();
javafx.geometry.Point3D p = new javafx.geometry.Point3D((bounds.getMaxX() + bounds.getMinX()) / 2d, (bounds.getMaxY() + bounds.getMinY()) / 2d, (bounds.getMaxZ() + bounds.getMinZ()) / 2d);
translate = new Translate(0, 0, 0);
rotateX = new Rotate(0, p.getX(), p.getY(), p.getZ(), Rotate.X_AXIS);
rotateY = new Rotate(0, p.getX(), p.getY(), p.getZ(), Rotate.Y_AXIS);
rotateZ = new Rotate(0, p.getX(), p.getY(), p.getZ(), Rotate.Z_AXIS);
scale = new Scale(1, 1, 1, p.getX(), p.getY(), p.getZ());
getTransforms().addAll(translate, rotateZ, rotateY, rotateX, scale);
}
Aggregations