Pro Java 9 Games Development Leveraging the JavaFX APIs

(Michael S) #1
Chapter 3 ■ advanCed 3d Content rendering: 3d asset ConCepts and prinCiples

JavaFX API 3D Modeling Support: Points, Polygons, Mesh, Transforms,


Shading


I will split the JavaFX 3D asset support into two diagrams, one for static 3D (rendered images) and one for
animated 3D (3D animation). Interactive 3D will use all of the JavaFX 3D capabilities plus some of the Java
API capabilities. The first diagram, Figure 3-7, shows the four major areas that are supported in JavaFX
packages. These are important for creating 3D models that can be used in static 3D imagery as well as with
other JavaFX APIs for animated 3D and with Java APIs for interactive 3D games, IoT applications, and 3D
simulations.


The javafx.geometry package contains the foundation for all 3D or 2D geometry in Java and
JavaFX, namely, the vertex (points) and space (bounds). The Point2D class supports both vertex (a point
in 2D space) and vector (a line in 2D space emanating from a point) representations. A Point3D class
also supports both vertex (a point in 3D space) and vector (a line in 3D space emanating from a point)
representations. The Bounds superclass represents the boundaries of a JavaFX Scene Graph Node and the
object that it contains. The BoundingBox subclass of the Bounds superclass contains a more specialized
representation of a Scene Graph Node object’s boundaries in 2D or 3D space.
The javafx.scene.shape package contains the Mesh, MeshView and TriangleMesh objects (classes)
used to create 3D geometry, and the javafx.scene.transform package contains the Rotate, Scale, Shear
and Transform objects (classes) used to apply 3D spatial transformations to your 3D geometry in 3D space.


Figure 3-7. High-level diagram of JavaFX 3D modeling asset support for geometry, shape, transform, and
texture map

Free download pdf