Pro Java 9 Games Development Leveraging the JavaFX APIs

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

If you are using volumetric textures, the spatial projection is a three-dimensional UVW texture
projection, which projects through a 3D object’s volume. It is typically used with procedural or volumetric
textures for materials that need to have an internal structure, such as wood, marble, sponge, agate, and
so forth. If you deform a 3D object or transform the texture mapping coordinate relative to the 3D object,
different parts of the volumetric or procedural texture will be revealed.
There’s also a simpler texture mapping called UV mapping (no W dimension). This applies the texture
in two dimensions, instead of three, and is easier to process because it has less data. We will probably map
our 3D models outside of JavaFX using 3D software and then use a model importer to import the already
texture-mapped 3D object into Java as the classes for some of this more advanced 3D map support have not
been added to the JavaFX API as of JavaFX 8.


Animating Your 3D Model: Keyframes, Motion Curves, and IK


After you have created your 3D geometry and texture mapped it using shaders and mapping coordinates,
you might want to make it move in some fashion, such as flying an airplane model, for instance. The
concepts that you learned about for digital video assets as well as for 2D animation assets in Chapter 2 apply
equally as well for 3D animation.


Linear Animation: Tracks, Keyframes, Looping, and Ranges


The simplest type of 3D animation, and 2D animation for that matter, is linear animation, which is fine for
many types of animation. Figure 3-5 shows how to add a keyframe to a cube object in Blender 2.8 using the
Insert Keyframe Menu.


Figure 3-5. Using the Insert Keyframe Menu in Blender 2.8 with a Cube object selected to add a Delta Scale
keyframe

Free download pdf