Pro Java 9 Games Development Leveraging the JavaFX APIs

(Michael S) #1

Chapter 3 ■ advanCed 3d Content rendering: 3d asset ConCepts and prinCiples


In Adobe Illustrator, control points are subdivided into using handles and anchor points. The handle
positions that are used to influence the curvature are the handles. The anchor points are the vertices
describing the start and end positions of the Bézier curve. Inkscape uses a different term for an anchor point,
calling it a node.
There is also a 3D modeling approach called NURBS, or Non-Uniform Rational B-Spline, which is
related to a Bezier spline representation but optimized for use in 3D X,Y,Z space. A NURBS is more complex
and allows a smooth, organic 3D geometry representation to be created. Moment of Inspiration 3D by
Michael Gibson is one of the really affordable NURBS modelers, at only $295; it is based on the original SGI
Alias Wavefront NURBS Modeler API.


Filling the Shape Interior: Color Fills, Gradients, and Patterns


If the 2D shapes that you create using these vertices and splines (or vectors/lines) are closed, then they can
be filled with various things such as solid colors, color gradients, or tiled image patterns. This is shown on
the bottom portion of Figure 3-1. To close a curve, draw your final vector (line) or spline (curve) until your
mouse cursor is over the starting vertex, and when that vertex changes (in Inkscape, it turns from black to
red), click down to create a closed shape. To fill the shape you just closed in Inkscape, click the Fill tool,
shown on the left along with the Spline/Line tool and their tooltips, and then click the color, along the
bottom swatches, to fill the selected shape with that color.


The 2D vector shape file format used by both Inkscape and JavaFX is Scalable Vector Graphics (SVG),
so if you save your Inkscape project, it will use the .svg extension, like ProjectName.svg, for instance. If
you want to learn more about SVG, take a look at Digital Illustration Fundamentals from Apress.com. Next
let’s take a look at i3D media assets, which are fully supported in Java 8 and 9 using the JavaFX 9 new media
engine.


Figure 3-1. Creating an open shape in Inkscape using vectors and splines, closing that shape, and then filling
the shape

Free download pdf