Java Code Examples for javafx.scene.transform.Affine#transform()
The following examples show how to use
javafx.scene.transform.Affine#transform() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Utils.java From gluon-samples with BSD 3-Clause "New" or "Revised" License | 5 votes |
private static Point3D getMeshNormal(MeshView mesh){ TriangleMesh tm = (TriangleMesh) mesh.getMesh(); float[] fPoints = new float[tm.getPoints().size()]; tm.getPoints().toArray(fPoints); Point3D BA = new Point3D(fPoints[3] - fPoints[0], fPoints[4] - fPoints[1], fPoints[5] - fPoints[2]); Point3D CA = new Point3D(fPoints[6] - fPoints[0], fPoints[7] - fPoints[1], fPoints[8] - fPoints[2]); Point3D normal = BA.crossProduct(CA); Affine a = new Affine(mesh.getTransforms().get(0)); return a.transform(normal.normalize()); }
Example 2
Source File: Utils.java From RubikFX with GNU General Public License v3.0 | 5 votes |
private static Point3D getMeshNormal(MeshView mesh){ TriangleMesh tm=(TriangleMesh)mesh.getMesh(); float[] fPoints=new float[tm.getPoints().size()]; tm.getPoints().toArray(fPoints); Point3D BA=new Point3D(fPoints[3]-fPoints[0],fPoints[4]-fPoints[1],fPoints[5]-fPoints[2]); Point3D CA=new Point3D(fPoints[6]-fPoints[0],fPoints[7]-fPoints[1],fPoints[8]-fPoints[2]); Point3D normal=BA.crossProduct(CA); Affine a=new Affine(mesh.getTransforms().get(0)); return a.transform(normal.normalize()); }