1 /*
2 * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
32 import com.sun.javafx.geom.BoxBounds;
33 import com.sun.javafx.geom.PickRay;
34 import com.sun.javafx.geom.Vec3d;
35 import com.sun.javafx.scene.input.PickResultChooser;
36 import com.sun.javafx.scene.shape.TriangleMeshHelper;
37 import com.sun.javafx.sg.prism.NGTriangleMesh;
38 import javafx.beans.property.ObjectProperty;
39 import javafx.beans.property.SimpleObjectProperty;
40 import javafx.collections.ArrayChangeListener;
41 import javafx.collections.FXCollections;
42 import javafx.collections.ObservableArray;
43 import javafx.collections.ObservableFloatArray;
44 import javafx.collections.ObservableIntegerArray;
45 import javafx.geometry.Point2D;
46 import javafx.geometry.Point3D;
47 import javafx.scene.Node;
48 import javafx.scene.input.PickResult;
49 import javafx.scene.transform.Affine;
50 import javafx.scene.transform.NonInvertibleTransformException;
51 import javafx.scene.transform.Rotate;
52 import sun.util.logging.PlatformLogger;
53
54 /**
55 * Defines a 3D triangle mesh that consists of its associated {@code VertexFormat}
56 * and a set of separate arrays of vertex components such as points, normals,
57 * texture coordinates, and an array of faces that define the individual triangles
58 * of the mesh.
59 *<p>
60 * Note that the term point, as used in the method names and method
61 * descriptions, actually refers to a 3D point (x, y, z) in space
62 * representing the position of a single vertex. The term points (plural) is
63 * used to indicate sets of 3D points for multiple vertices.
64 * Similarly, the term normal is used to indicate a 3D vector (nx, ny, nz) in space
65 * representing the direction of a single vertex. The term normals (plural) is
66 * used to indicate sets of 3D vectors for multiple vertices.
67 * The term texCoord is used to indicate a single pair of 2D texture
68 * coordinates (u, v) for a single vertex, while the term texCoords (plural) is used
69 * to indicate sets of texture coordinates for multiple vertices.
70 * Lastly, the term face is used to indicate 3 sets of interleaving points,
71 * normals (optional, depending on the associated VertexFormat)
72 * and texture coordinates that together represent the geometric topology of a
|
1 /*
2 * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
32 import com.sun.javafx.geom.BoxBounds;
33 import com.sun.javafx.geom.PickRay;
34 import com.sun.javafx.geom.Vec3d;
35 import com.sun.javafx.scene.input.PickResultChooser;
36 import com.sun.javafx.scene.shape.TriangleMeshHelper;
37 import com.sun.javafx.sg.prism.NGTriangleMesh;
38 import javafx.beans.property.ObjectProperty;
39 import javafx.beans.property.SimpleObjectProperty;
40 import javafx.collections.ArrayChangeListener;
41 import javafx.collections.FXCollections;
42 import javafx.collections.ObservableArray;
43 import javafx.collections.ObservableFloatArray;
44 import javafx.collections.ObservableIntegerArray;
45 import javafx.geometry.Point2D;
46 import javafx.geometry.Point3D;
47 import javafx.scene.Node;
48 import javafx.scene.input.PickResult;
49 import javafx.scene.transform.Affine;
50 import javafx.scene.transform.NonInvertibleTransformException;
51 import javafx.scene.transform.Rotate;
52 import com.sun.javafx.logging.PlatformLogger;
53
54 /**
55 * Defines a 3D triangle mesh that consists of its associated {@code VertexFormat}
56 * and a set of separate arrays of vertex components such as points, normals,
57 * texture coordinates, and an array of faces that define the individual triangles
58 * of the mesh.
59 *<p>
60 * Note that the term point, as used in the method names and method
61 * descriptions, actually refers to a 3D point (x, y, z) in space
62 * representing the position of a single vertex. The term points (plural) is
63 * used to indicate sets of 3D points for multiple vertices.
64 * Similarly, the term normal is used to indicate a 3D vector (nx, ny, nz) in space
65 * representing the direction of a single vertex. The term normals (plural) is
66 * used to indicate sets of 3D vectors for multiple vertices.
67 * The term texCoord is used to indicate a single pair of 2D texture
68 * coordinates (u, v) for a single vertex, while the term texCoords (plural) is used
69 * to indicate sets of texture coordinates for multiple vertices.
70 * Lastly, the term face is used to indicate 3 sets of interleaving points,
71 * normals (optional, depending on the associated VertexFormat)
72 * and texture coordinates that together represent the geometric topology of a
|