下面列出了javafx.scene.transform.Affine#transform ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
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());
}
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());
}