|
|
@@ -1,622 +1,261 @@
|
|
|
-
|
|
|
-<h1><a>3D Game Development Terminology</a></h1>
|
|
|
-<div>
|
|
|
-
|
|
|
-<p>
|
|
|
-
|
|
|
-Before you start, make certain you are familiar with the following concepts and terminology.
|
|
|
-</p>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h1><a>3D Graphics and Audio</a></h1>
|
|
|
-<div>
|
|
|
-
|
|
|
-<p>
|
|
|
-
|
|
|
-<strong>OpenGL</strong> is the Open Graphics Library, a platform-independent specification for rendering 2D/3D computer graphics. For Java, there are two implementations of OpenGL-based renderers:
|
|
|
-</p>
|
|
|
-<ol>
|
|
|
-<li><div> Lightweight Java Game Library (LWJGL)</div>
|
|
|
-</li>
|
|
|
-<li><div> Java OpenGL (JOGL)</div>
|
|
|
-</li>
|
|
|
-</ol>
|
|
|
-
|
|
|
-<p>
|
|
|
-
|
|
|
-<strong>OpenAL</strong> is the Open Audio Library, a platform-independent 3D audio <acronym title="Application Programming Interface">API</acronym>.
|
|
|
-</p>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h1><a>Context, Display, Renderer</a></h1>
|
|
|
-<div>
|
|
|
-
|
|
|
-<p>
|
|
|
-
|
|
|
-The <strong>jME Context</strong> makes settings, renderer, timer, input and event listeners, display system, accessible to a JME game.
|
|
|
-</p>
|
|
|
-<ul>
|
|
|
-<li><div> The <strong>jME Display System</strong> is what draws the custom JME window (instead of Java Swing). </div>
|
|
|
-</li>
|
|
|
-<li><div> The <strong>input system</strong> is what lets you respond to user input via mouse, keyboard, and joystick.</div>
|
|
|
-</li>
|
|
|
-<li><div> The <strong>renderer</strong> is what does all the work of calculating how to draw the 3D scenegraph to the 2D screen.</div>
|
|
|
-<ul>
|
|
|
-<li><div> The <strong>Shader</strong> is a programmable part of the rendering pipeline. The jME3 game engine uses it to offer advanced customizable materials.</div>
|
|
|
-</li>
|
|
|
-</ul>
|
|
|
-</li>
|
|
|
-</ul>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h1><a>Geometry</a></h1>
|
|
|
-<div>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h2><a>Coordinates</a></h2>
|
|
|
-<div>
|
|
|
-
|
|
|
-<p>
|
|
|
-
|
|
|
-Coordinates represent a location in a coordinate system, relative to the origin (0,0,0). m. In 3D space, you need to specify three coordinate values to locate a point: x,y,z.
|
|
|
-As opposed to a vector (which looks similar), a coordinate does not have a “direction”.
|
|
|
-</p>
|
|
|
-
|
|
|
-<p>
|
|
|
-<img src="nbdocs:/com/jme3/gde/core/docs/jme3/intermediate/coordinate-system.png">
|
|
|
-</p>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h3><a>The Origin</a></h3>
|
|
|
-<div>
|
|
|
-
|
|
|
-<p>
|
|
|
-
|
|
|
-The origin is the central point in the 3D world. It's at the coordinates (0,0,0).
|
|
|
-</p>
|
|
|
-
|
|
|
-<p>
|
|
|
-Code sample: <code>Vector3f origin = new Vector3f( Vector3f.ZERO );</code>
|
|
|
-</p>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h2><a>Vectors</a></h2>
|
|
|
-<div>
|
|
|
-
|
|
|
-<p>
|
|
|
-
|
|
|
-A vector has a length and a direction. It is used like an arrow pointing at a point in 3D space. A vector starts at the origin (0,0,0), and ends at the target coordinate (x,y,z). Backwards directions are expressed with negative values.
|
|
|
-</p>
|
|
|
-
|
|
|
-<p>
|
|
|
-Code sample: <code>Vector3f v = new Vector3f( 17 , -4 , 0 );</code>
|
|
|
-</p>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h3><a>Unit Vectors</a></h3>
|
|
|
-<div>
|
|
|
-
|
|
|
-<p>
|
|
|
-
|
|
|
-A <em>unit vector</em> is a basic vector with a length of 1 world unit. Since its length is fixed (and it thus can only point at one location anyway), the only interesting thing about this vector is its direction.
|
|
|
-</p>
|
|
|
-<ul>
|
|
|
-<li><div> <code>Vector3f.UNIT_X</code> = ( 1, 0, 0) = right</div>
|
|
|
-</li>
|
|
|
-<li><div> <code>Vector3f.UNIT_Y</code> = ( 0, 1, 0) = up</div>
|
|
|
-</li>
|
|
|
-<li><div> <code>Vector3f.UNIT_Z</code> = ( 0, 0, 1) = forwards</div>
|
|
|
-</li>
|
|
|
-<li><div> <code>Vector3f.UNIT_XYZ</code> = 1 wu diagonal right-up-forewards </div>
|
|
|
-</li>
|
|
|
-</ul>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h3><a>Normalized Vectors</a></h3>
|
|
|
-<div>
|
|
|
-
|
|
|
-<p>
|
|
|
-
|
|
|
-A <em>normalized vector</em> is a custom <em>unit vector</em>. A normalized vector is not the same as a <em>(surface) normal vector</em>.
|
|
|
-</p>
|
|
|
-
|
|
|
-<p>
|
|
|
-When you normalize a vector, it still has the same direction, but you lose the information where the vector originally pointed.
|
|
|
-</p>
|
|
|
-
|
|
|
-<p>
|
|
|
-For instance, you normalize vectors before calculating angles.
|
|
|
-</p>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h3><a>Surface Normals</a></h3>
|
|
|
-<div>
|
|
|
-
|
|
|
-<p>
|
|
|
-
|
|
|
-A surface normal is a vector that is perpendicular to a plane.
|
|
|
-You calculate the Surface Normal by calculating the cross product.
|
|
|
-</p>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h3><a>Cross Product</a></h3>
|
|
|
-<div>
|
|
|
-
|
|
|
-<p>
|
|
|
-
|
|
|
-The cross product is a calculation that you use to find a perpendicular vector (an orthogonal, a “right angle” at 90°).
|
|
|
-</p>
|
|
|
-
|
|
|
-<p>
|
|
|
-In 3D space, speaking of an orthogonal only makes sense with respect to a plane. You need two vectors to uniquely define a plane. The cross product of the two vectors, <code>v1 × v2</code>, is a new vector that is perpendicular to this plane. A vector perpendicular to a plane is a called <em>Surface Normal</em>.
|
|
|
-</p>
|
|
|
-
|
|
|
-<p>
|
|
|
-Example: The x unit vector and the y unit vector together define the x/y plane. The vector perpendicular to them is the z axis. JME can calculate that this equation is true: <br/>
|
|
|
-
|
|
|
-<code>( Vector3f.UNIT_X.cross( Vector3f.UNIT_Y ) ).equals( Vector3f.UNIT_Z )</code> == true
|
|
|
-</p>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h2><a>Polygon, Mesh, Vertex</a></h2>
|
|
|
-<div>
|
|
|
-
|
|
|
-<p>
|
|
|
-
|
|
|
-<img src="nbdocs:/com/jme3/gde/core/docs/jme3/dolphin-mesh.png">
|
|
|
-</p>
|
|
|
-
|
|
|
-<p>
|
|
|
-Most visible objects in a 3D scene are made up of polygon meshes – characters, terrains, buildings, etc. A mesh is a grid-like structure that represents a complex shape. The advantage of a mesh is that it is mathematically simple enough to render in real time, and detailed enough to be recognizable.
|
|
|
-</p>
|
|
|
-
|
|
|
-<p>
|
|
|
-Every shape is reduced to a number of connected polygons, usually triangles; even round surfaces such as spheres are reduced to a grid of triangles. The polygons' corner points are called vertices. Every vertex is positioned at a coordinate, all vertices together describe the outline of the shape.
|
|
|
-</p>
|
|
|
-
|
|
|
-<p>
|
|
|
-You create 3D meshes in tools called mesh editors, e.g in Blender.
|
|
|
-</p>
|
|
|
-
|
|
|
-<p>
|
|
|
-<a href="/com/jme3/gde/core/docs/jme3/math.html">Learn more about 3D maths here.</a>
|
|
|
-</p>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h1><a>Materials: Color, Lighting/Shading</a></h1>
|
|
|
-<div>
|
|
|
-
|
|
|
-<p>
|
|
|
-
|
|
|
-What we call “color” is merely part of an object's light reflection. The onlooker's brain uses shading and reflecting properties to infer an object's shape and material. Factors like these make all the difference between chalk vs milk, skin vs paper, water vs plastic, etc! (<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://www.shaders.org/ifw2_textures/whatsin10.htm"><param name="text" value="<html><u>External examples</u></html>"><param name="textColor" value="blue"></object>)
|
|
|
-</p>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h2><a>Color</a></h2>
|
|
|
-<div>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h3><a>Ambient color</a></h3>
|
|
|
-<div>
|
|
|
-<ul>
|
|
|
-<li><div> The uniform base color of the mesh – what it looks like when not influenced by any light source.</div>
|
|
|
-</li>
|
|
|
-<li><div> Usually similar to the Diffuse color. </div>
|
|
|
-</li>
|
|
|
-<li><div> This is the minimum color you need for an object to be visible.</div>
|
|
|
-</li>
|
|
|
-</ul>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h3><a>Diffuse color</a></h3>
|
|
|
-<div>
|
|
|
-<ul>
|
|
|
-<li><div> The base color of the mesh plus shattered light and shadows that are caused by a light source.</div>
|
|
|
-</li>
|
|
|
-<li><div> Usually similar to the Ambient color.</div>
|
|
|
-</li>
|
|
|
-</ul>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h2><a>Light Sources</a></h2>
|
|
|
-<div>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h3><a>Emissive color</a></h3>
|
|
|
-<div>
|
|
|
-<ul>
|
|
|
-<li><div> The color of light emitted by a light source or glowing material. </div>
|
|
|
-</li>
|
|
|
-<li><div> Only glowing materials such as lights have an emissive color, normal objects don't have this property. </div>
|
|
|
-</li>
|
|
|
-<li><div> Often white (sun light).</div>
|
|
|
-</li>
|
|
|
-</ul>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h2><a>Reflections</a></h2>
|
|
|
-<div>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h3><a>Shininess</a></h3>
|
|
|
-<div>
|
|
|
-<ul>
|
|
|
-<li><div> Degree of shininess of a surface (0-128).</div>
|
|
|
-</li>
|
|
|
-<li><div> Shiny objects have small, clearly outlined specular highlights. (E.g. glass, water, silver)</div>
|
|
|
-</li>
|
|
|
-<li><div> Normal objects have wide, blurry specular highlights. (E.g. metal, plastic, stone, polished materials)</div>
|
|
|
-</li>
|
|
|
-<li><div> Uneven objects are not shiny and have no specular highlights. (E.g. cloth, paper, wood, snow)</div>
|
|
|
-</li>
|
|
|
-</ul>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h3><a>Specular Color</a></h3>
|
|
|
-<div>
|
|
|
-<ul>
|
|
|
-<li><div> If the material is shiny, then the Specular Color is the color of the reflected highlights. </div>
|
|
|
-</li>
|
|
|
-<li><div> Usually the same as the emissive color of the light source (e.g. white). </div>
|
|
|
-</li>
|
|
|
-<li><div> You can use colors to achieve special specular effects, such as metallic or iridescent reflections.</div>
|
|
|
-</li>
|
|
|
-<li><div> Non-shiny objects don't use a specular color.</div>
|
|
|
-</li>
|
|
|
-</ul>
|
|
|
-
|
|
|
-<p>
|
|
|
-
|
|
|
-<img src="/wiki/lib/exe/fetch.php">
|
|
|
-</p>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h1><a>Materials: Textures</a></h1>
|
|
|
-<div>
|
|
|
-
|
|
|
-<p>
|
|
|
-
|
|
|
-Textures are part of Materials. In the simplest case, an object could have just one texture, the Color Map, loaded from one image file. When you think back of old computer games you'll remember this looks quite plain.
|
|
|
-</p>
|
|
|
-
|
|
|
-<p>
|
|
|
-The more information you (the game designer) provide additionally to the Color Map, the higher the degree of detail and realism. Whether you want photo-realistic rendering or “toon” rendering (Cel Shading), everything depends on the quality of your materials and texture maps. Modern 3D graphics use several layers of information to describe one material, each layer is a Texture Map.
|
|
|
-</p>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h2><a>Texture Maps</a></h2>
|
|
|
-<div>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h3><a>Color Map</a></h3>
|
|
|
-<div>
|
|
|
-
|
|
|
-<p>
|
|
|
-
|
|
|
-<img src="/wiki/lib/exe/fetch.php">
|
|
|
-</p>
|
|
|
-<ul>
|
|
|
-<li><div> A simple image file (or a procedural texture). </div>
|
|
|
-</li>
|
|
|
-<li><div> The image can have alpha channels for transparency. </div>
|
|
|
-</li>
|
|
|
-<li><div> <strong>A color map is the minimum texture you need.</strong> All other texture maps are optional improvements.</div>
|
|
|
-</li>
|
|
|
-</ul>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h3><a>Diffuse Map</a></h3>
|
|
|
-<div>
|
|
|
-
|
|
|
-<p>
|
|
|
-
|
|
|
-<img src="/wiki/lib/exe/fetch.php">
|
|
|
-</p>
|
|
|
-<ul>
|
|
|
-<li><div> The Diffuse Map specifies the intensity of color. </div>
|
|
|
-</li>
|
|
|
-<li><div> Its basically the same as a Color Map but its called Diffuse Map in a lighting environment, as it defines the color the object “diffuses”.</div>
|
|
|
-</li>
|
|
|
-</ul>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h3><a>Bump Map</a></h3>
|
|
|
-<div>
|
|
|
-
|
|
|
-<p>
|
|
|
-
|
|
|
-Bump maps are used to describe detailed shapes that would be too hard or simply too inefficient to sculpt in a mesh editor. You use Normal Maps to model cracks in walls, rust, skin texture, or a canvas weave. You use Height Maps to model whole terrains with valleys and mountains.
|
|
|
-</p>
|
|
|
-
|
|
|
-<p>
|
|
|
-<img src="/wiki/lib/exe/fetch.php">
|
|
|
-</p>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h4><a>Height Map</a></h4>
|
|
|
-<div>
|
|
|
-<ul>
|
|
|
-<li><div> A height map is a grayscale image looking similar to a terrain map used in topography. Brighter grays represent higher areas and darker grays lower areas. </div>
|
|
|
-</li>
|
|
|
-<li><div> A heightmap can represent 256 height levels and is mostly used to roughly outline terrains.</div>
|
|
|
-</li>
|
|
|
-<li><div> You can draw a heightmap by hand in any image editor.</div>
|
|
|
-</li>
|
|
|
-</ul>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h4><a>Normal Map</a></h4>
|
|
|
-<div>
|
|
|
-
|
|
|
-<p>
|
|
|
-
|
|
|
-<img src="/wiki/lib/exe/fetch.php">
|
|
|
-</p>
|
|
|
-<ul>
|
|
|
-<li><div> A well-done Normal Map makes a shape more detailed–without the need to add costly polygons to the mesh. It contains shading information that makes the object appear smoother and more fine-grained.</div>
|
|
|
-</li>
|
|
|
-<li><div> The Normal Map is displayed looking like a false-color version of the Color Map–but it is never used for coloring, instead, each RGB value encodes transformation data. This displacement data is represented by Surface Normals of the slopes, hence the name. </div>
|
|
|
-</li>
|
|
|
-<li><div> It's hard to draw normal maps by hand. Generally you use software tools to calculate them off 3D models.</div>
|
|
|
-</li>
|
|
|
-</ul>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h3><a>Specular Map</a></h3>
|
|
|
-<div>
|
|
|
-
|
|
|
-<p>
|
|
|
-
|
|
|
-<img src="/wiki/lib/exe/fetch.php">
|
|
|
-</p>
|
|
|
-<ul>
|
|
|
-<li><div> A Specular Map further improves the realism of an object's surface: It contains extra information about shininess and makes the shape appear more realistically illumated. </div>
|
|
|
-</li>
|
|
|
-<li><div> Start out with a gray value that corresponds to the average shininess/dullness of this material. Then add ligher grays for smoother, shinier, more reflective areas; and darker grays for duller, rougher, worn-out areas. The resulting image file looks similar to a grayscale version of the Color Map.</div>
|
|
|
-</li>
|
|
|
-<li><div> You can use colors in a specular map to create certain reflective effects (iridiscence, metallic). </div>
|
|
|
-</li>
|
|
|
-</ul>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h2><a>Seamless Tiled Textures</a></h2>
|
|
|
-<div>
|
|
|
-
|
|
|
-<p>
|
|
|
-
|
|
|
-<img src="/wiki/lib/exe/fetch.php">
|
|
|
-</p>
|
|
|
-
|
|
|
-<p>
|
|
|
-This is a very simple, commonly used type of texture. When texturing a wide area (e.g. walls, floors), you don't create one huge texture, instead you tile a small texture repeatedly to fill the area.
|
|
|
-</p>
|
|
|
-
|
|
|
-<p>
|
|
|
-A seamless texture is an image file that has been designed so that it can be used as tiles: The right edge matches the left edge, and the top edge matches the bottom edge. The onlooker cannot easily tell where one starts and the next one ends, thus creating an illusion of a huge texture. The downside is that the tiling becomes painfully obvious when the area is viewed from a distance. Also you cannot use it on more complex models such as characters.
|
|
|
-</p>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h2><a>UV Maps</a></h2>
|
|
|
-<div>
|
|
|
-
|
|
|
-<p>
|
|
|
-
|
|
|
-<img src="/wiki/lib/exe/fetch.php">
|
|
|
-</p>
|
|
|
-
|
|
|
-<p>
|
|
|
-Creating a texture for a cube is easy – but what about a character with a face and extremities? For more complex objects, you design the texture in the same ways as a sewing pattern: One image file contains the outline of the front, back, and side of the object, next to one another. Specific areas of the flat texture (UV coordinates) map onto certain areas of your 3D model (XYZ coordinates), hence the name UV map.
|
|
|
-</p>
|
|
|
-
|
|
|
-<p>
|
|
|
-Getting the seams and mappings right is crucial: You will have to use a graphic tool like Blender to create UV Maps. It's worth the while to learn this, UV mapped models look a lot more professional.
|
|
|
-</p>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h2><a>Environment Maps</a></h2>
|
|
|
-<div>
|
|
|
-
|
|
|
-<p>
|
|
|
-
|
|
|
-<img src="/wiki/lib/exe/fetch.php">
|
|
|
-Environment Maps are used to create the impression of reflections and refractions. You create a Cube Map to represent your environment, similar to a skybox. (Sphere Maps are possible, but often look too distorted.) You give the Cube Map a set of images showing a “360° view” of the completed scene. The renderer uses this as base to texture the reflective surface.
|
|
|
-</p>
|
|
|
-
|
|
|
-<p>
|
|
|
-Of course these reflections are static and not “real”, e.g. the player will not see his avatar's face reflected, etc… But they cause the desired “glass/mirror/water” effect, and are fast enough to render in real usecases, it's better than nothing.
|
|
|
-</p>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h2><a>MIP Map Texture</a></h2>
|
|
|
-<div>
|
|
|
-
|
|
|
-<p>
|
|
|
-
|
|
|
-You provide the texture in two or three resolutions to be stored in one file (MIP = “multum in parvo” = “many in one”). Depending on how close (or far) the camera is, the engine automatically renders a more (or less) detailed texture for the object. Thus objects look smooth from close up, but don't waste resources with unspottable details when far away. Good for everything, but requires more time to create and more space to store textures.
|
|
|
-</p>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h2><a>Procedural Textures</a></h2>
|
|
|
-<div>
|
|
|
-
|
|
|
-<p>
|
|
|
-
|
|
|
-A procedural texture is generated from repeating one small image, plus some pseudo-random, gradient variations (Perlin noise). Procedural textures look more natural than static rectangular textures, for instance, they look less distorted on spheres. On big meshes, their repetitiveness is much less noticable than tiled seamless textures. Procedural textures are ideal for irregular large-area textures like grass, soil, rock, rust, and walls. See also: <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.org/wiki/doku.php/jme3:jmonkeyplatform:neotexture"><param name="text" value="<html><u>jMonkeyPlatform NeoTexture plugin</u></html>"><param name="textColor" value="blue"></object>
|
|
|
-</p>
|
|
|
-
|
|
|
-<p>
|
|
|
-<img src="/wiki/lib/exe/fetch.php">
|
|
|
-</p>
|
|
|
-
|
|
|
-<p>
|
|
|
-See also: <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://www.blender.org/education-help/tutorials/materials/"><param name="text" value="<html><u>Creating Materials in Blender</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro/Every_Material_Known_to_Man"><param name="text" value="<html><u>Blender: Every Material Known to Man</u></html>"><param name="textColor" value="blue"></object>
|
|
|
-</p>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h1><a>Animation</a></h1>
|
|
|
-<div>
|
|
|
-
|
|
|
-<p>
|
|
|
-
|
|
|
-In 3D games, Skeletal Animation is used for animated characters, but in principle the skeleton approach can be extended to any 3D mesh (for example, an opening crate's hinge can be considered a joint).
|
|
|
-</p>
|
|
|
-
|
|
|
-<p>
|
|
|
-Unless you animate a 3D cartoon, realism of animated characters is generally a problem: Movement can look alien-like mechanical or broken, the character appears hollow, or as if floating. Professional game designers invest a lot of effort to make characters animate in a natural way (including motion capturing).
|
|
|
-</p>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h2><a>Rigging and Skinning</a></h2>
|
|
|
-<div>
|
|
|
-
|
|
|
-<p>
|
|
|
-
|
|
|
-<img src="/wiki/lib/exe/fetch.php">
|
|
|
-</p>
|
|
|
-
|
|
|
-<p>
|
|
|
-An animated character has an armature: An internal skeleton (Bones) and an external surface (Skin). The Skin is the visible outside of the character and it includes clothing. The Bones are not visible and are used to interpolate (calculate) the morphing steps of the skin.
|
|
|
-</p>
|
|
|
-
|
|
|
-<p>
|
|
|
-JME3, the game engine, only loads and plays your recorded animations. You must use a tool (such as Blender) to set up (rig, skin, and animate) a character.
|
|
|
-
|
|
|
-</p>
|
|
|
-<ol>
|
|
|
-<li><div> <strong>Rigging:</strong> The Construction of a character's skeleton. </div>
|
|
|
-<ul>
|
|
|
-<li><div> Create as few Bones as possible to decrease complexity. </div>
|
|
|
-</li>
|
|
|
-<li><div> Bones are connected in a parent-child hierarchy: Moving one bone can pull another bone with it (e.g. arm pulls hand). </div>
|
|
|
-</li>
|
|
|
-<li><div> Bones follow a certain naming scheme so the 3D engines know what's what.</div>
|
|
|
-</li>
|
|
|
-</ul>
|
|
|
-</li>
|
|
|
-<li><div> <strong>Skinning:</strong> The association of individual bones with the corresponding skin sections. </div>
|
|
|
-<ul>
|
|
|
-<li><div> Each Bone is connected to a part of the Skin. Animating the (invisible) Bone pulls the (visible) Skin with it. <br/>
|
|
|
- E.g. the thigh Bone is connected to the upper leg Skin.</div>
|
|
|
-</li>
|
|
|
-<li><div> One part of the Skin can be affected by more than one bone (e.g. knee, elbow).</div>
|
|
|
-</li>
|
|
|
-<li><div> The connection between bones and skin sections is gradual: You assign weights how much each skin polygon is affected by any bone's motion. <br/>
|
|
|
- E.g. when the thigh bone moves, the leg is fully affected, the hips joints less so, and the head not at all.</div>
|
|
|
-</li>
|
|
|
-</ul>
|
|
|
-</li>
|
|
|
-<li><div> <strong>Keyframe Animation:</strong> A keyframe is one recorded snapshot of a motion sequence.</div>
|
|
|
-<ul>
|
|
|
-<li><div> A series of keyframes makes up one animation. </div>
|
|
|
-</li>
|
|
|
-<li><div> Each model can have several animations. Each animation has a name to identify it (e.g. “walk”, “attack”, “jump”). </div>
|
|
|
-</li>
|
|
|
-<li><div> You specify in your game code which keyframe animation to load, and when to play it.</div>
|
|
|
-</li>
|
|
|
-</ul>
|
|
|
-</li>
|
|
|
-</ol>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h2><a>Kinematics</a></h2>
|
|
|
-<div>
|
|
|
-<ul>
|
|
|
-<li><div> Forward kinematics: “Given the angles of all the character's joints, what is the position of the character's hand?”</div>
|
|
|
-</li>
|
|
|
-<li><div> Inverse kinematics: “Given the position of the character's hand, what are the angles of all the character's joints?” </div>
|
|
|
-</li>
|
|
|
-</ul>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h2><a>Controller and Channel</a></h2>
|
|
|
-<div>
|
|
|
-
|
|
|
-<p>
|
|
|
-
|
|
|
-In the JME3 application, you register animated models to the Animation Controller. The controller object gives you access to the available animation sequences. The controller has several channels, each channels can run one animation sequence at a time. To run several sequences, you create several channels, and run them in parallel.
|
|
|
-</p>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<h1><a>Artificial Intelligence (AI)</a></h1>
|
|
|
-<div>
|
|
|
-
|
|
|
-<p>
|
|
|
-
|
|
|
-Non-player (computer-controlled) characters (NPCs) are only fun in a game if they do not stupidly bump into walls, or blindly run into the line of fire. You want to make NPCs “aware” of their surroundings and let them make decisions based on the game state – otherwise the player can just ignore them. The most common use case is that you want to make enemies interact in a way so they offer a more interesting challenge for the player.
|
|
|
-</p>
|
|
|
-
|
|
|
-<p>
|
|
|
-“Smart” game elements are called artificially intelligent agents (AI agents). An AI agent can be an NPC, but also an “automatic alarm system” that locks doors after an intruder alert, or a trained pet.
|
|
|
-</p>
|
|
|
-
|
|
|
-<p>
|
|
|
-The domain of artificial intelligence deals, among other things, with:
|
|
|
-</p>
|
|
|
-<ul>
|
|
|
-<li><div> Knowledge – An agent only “knows” what it can “see and hear”, this implies that things can be hidden from it. You can make a group of agents share knowledge (e.g. guards with two-way radios know, other guards don't know about the intruder).</div>
|
|
|
-</li>
|
|
|
-<li><div> Goal Planning – The agent has a priority to achieve a specific goal (a future state). It splits the goal into subgoals, determines tactics and strategies, and prioritizes them. The agent keeps testing whether the current state is closer to the (sub)goal. If unsuccessful, the agent changes the tactics/strategy. E.g. Finding the best path to reach a target in a changing environment.</div>
|
|
|
-</li>
|
|
|
-<li><div> Problem solving – The agent uses a given set of facts and rules to deduct what state it is in. In every state, only a certain subset of reactions makes sense. The actual decision depends on the agent's goal. Examples: If target in range, attack or protect base or raise alarm. If idle, lay traps or heal oneself or recharge ammunition. If floor on fire, then danger. If danger, escape or kamikaze.</div>
|
|
|
-</li>
|
|
|
-</ul>
|
|
|
-
|
|
|
-<p>
|
|
|
-
|
|
|
-There are lots of resources explaining interesting AI algorithms:
|
|
|
-</p>
|
|
|
-<ul>
|
|
|
-<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://www.policyalmanac.org/games/aStarTutorial.htm"><param name="text" value="<html><u>A* (A-Star) pathfinding for beginners</u></html>"><param name="textColor" value="blue"></object></div>
|
|
|
-</li>
|
|
|
-<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://theory.stanford.edu/~amitp/GameProgramming/"><param name="text" value="<html><u>A* (A-star) pathfinding theory</u></html>"><param name="textColor" value="blue"></object></div>
|
|
|
-</li>
|
|
|
-<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://hem.fyristorg.com/dawnbringer/z-path.html"><param name="text" value="<html><u>"Z-Path" algorithm</u></html>"><param name="textColor" value="blue"></object> (backwards pathfinding)</div>
|
|
|
-</li>
|
|
|
-<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://web.media.mit.edu/~jorkin/goap.html"><param name="text" value="<html><u>Goal-Oriented Action Planning</u></html>"><param name="textColor" value="blue"></object></div>
|
|
|
-</li>
|
|
|
-<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://neuroph.sourceforge.net/"><param name="text" value="<html><u>Java Neural Networks</u></html>"><param name="textColor" value="blue"></object></div>
|
|
|
-</li>
|
|
|
-<li><div> …</div>
|
|
|
-</li>
|
|
|
-</ul>
|
|
|
-
|
|
|
-</div>
|
|
|
+<h1><a
|
|
|
+name="d_game_development_terminology">3D Game Development Terminology</a></h1><div
|
|
|
+class="level1"><p> Before you start, make certain you are familiar with the following concepts and terminology.</p></div><h1><a
|
|
|
+name="d_graphics_and_audio">3D Graphics and Audio</a></h1><div
|
|
|
+class="level1"><p> <strong>OpenGL</strong> is the Open Graphics Library, a platform-independent specification for rendering 2D/3D computer graphics. For Java, there are two implementations of OpenGL-based renderers:</p><ol><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> Lightweight Java Game Library (LWJGL)</div></li><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> Java OpenGL (JOGL)</div></li></ol><p> <strong>OpenAL</strong> is the Open Audio Library, a platform-independent 3D audio <acronym
|
|
|
+title="Application Programming Interface">API</acronym>.</p></div><h1><a
|
|
|
+name="context_display_renderer">Context, Display, Renderer</a></h1><div
|
|
|
+class="level1"><p> The <strong>jME Context</strong> makes settings, renderer, timer, input and event listeners, display system, accessible to a JME game.</p><ul><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> The <strong>jME Display System</strong> is what draws the custom JME window (instead of Java Swing).</div></li><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> The <strong>input system</strong> is what lets you respond to user input via mouse, keyboard, and joystick.</div></li><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> The <strong>renderer</strong> is what does all the work of calculating how to draw the 3D scenegraph to the 2D screen.</div><ul><li
|
|
|
+class="level2"><div
|
|
|
+class="li"> The <strong>Shader</strong> is a programmable part of the rendering pipeline. The jME3 game engine uses it to offer advanced customizable materials.</div></li></ul></li></ul></div><h1><a
|
|
|
+name="geometry">Geometry</a></h1><div
|
|
|
+class="level1"></div><h2><a
|
|
|
+name="coordinates">Coordinates</a></h2><div
|
|
|
+class="level2"><p> Coordinates represent a location in a coordinate system, relative to the origin (0,0,0). m. In 3D space, you need to specify three coordinate values to locate a point: x,y,z.
|
|
|
+As opposed to a vector (which looks similar), a coordinate does not have a "direction". <a
|
|
|
+href="/wiki/lib/exe/detail.php/jme3:intermediate:coordinate-system.png?id=jme3%3Aterminology"><img
|
|
|
+src="nbdocs:/com/jme3/gde/core/docs/jme3/intermediate/coordinate-system.png?w=235&h=210" class="mediaright" align="right" alt="" width="235" height="210" /></a></p></div><h3><a
|
|
|
+name="the_origin">The Origin</a></h3><div
|
|
|
+class="level3"><p> The origin is the central point in the 3D world. It's at the coordinates (0,0,0).
|
|
|
+Code sample: <code>Vector3f origin = new Vector3f( Vector3f.ZERO );</code></p></div><h2><a
|
|
|
+name="vectors">Vectors</a></h2><div
|
|
|
+class="level2"><p> A vector has a length and a direction. It is used like an arrow pointing at a point in 3D space. A vector starts at the origin (0,0,0), and ends at the target coordinate (x,y,z). Backwards directions are expressed with negative values.
|
|
|
+Code sample: <code>Vector3f v = new Vector3f( 17 , -4 , 0 );</code></p></div><h3><a
|
|
|
+name="unit_vectors">Unit Vectors</a></h3><div
|
|
|
+class="level3"><p> A <em>unit vector</em> is a basic vector with a length of 1 world unit. Since its length is fixed (and it thus can only point at one location anyway), the only interesting thing about this vector is its direction.</p><ul><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> <code>Vector3f.UNIT_X</code> = ( 1, 0, 0) = right</div></li><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> <code>Vector3f.UNIT_Y</code> = ( 0, 1, 0) = up</div></li><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> <code>Vector3f.UNIT_Z</code> = ( 0, 0, 1) = forwards</div></li><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> <code>Vector3f.UNIT_XYZ</code> = 1 wu diagonal right-up-forewards</div></li></ul></div><h3><a
|
|
|
+name="normalized_vectors">Normalized Vectors</a></h3><div
|
|
|
+class="level3"><p> A <em>normalized vector</em> is a custom <em>unit vector</em>. A normalized vector is not the same as a <em>(surface) normal vector</em>.
|
|
|
+When you normalize a vector, it still has the same direction, but you lose the information where the vector originally pointed.
|
|
|
+For instance, you normalize vectors before calculating angles.</p></div><h3><a
|
|
|
+name="surface_normals">Surface Normals</a></h3><div
|
|
|
+class="level3"><p> A surface normal is a vector that is perpendicular to a plane.
|
|
|
+You calculate the Surface Normal by calculating the cross product.</p></div><h3><a
|
|
|
+name="cross_product">Cross Product</a></h3><div
|
|
|
+class="level3"><p> The cross product is a calculation that you use to find a perpendicular vector (an orthogonal, a "right angle" at 90°).
|
|
|
+In 3D space, speaking of an orthogonal only makes sense with respect to a plane. You need two vectors to uniquely define a plane. The cross product of the two vectors, <code>v1 × v2</code>, is a new vector that is perpendicular to this plane. A vector perpendicular to a plane is a called <em>Surface Normal</em>.
|
|
|
+Example: The x unit vector and the y unit vector together define the x/y plane. The vector perpendicular to them is the z axis. JME can calculate that this equation is true: <br/> <code>( Vector3f.UNIT_X.cross( Vector3f.UNIT_Y ) ).equals( Vector3f.UNIT_Z )</code> == true</p></div><h2><a
|
|
|
+name="polygon_mesh_vertex">Polygon, Mesh, Vertex</a></h2><div
|
|
|
+class="level2"><p> <a
|
|
|
+href="/wiki/lib/exe/detail.php/jme3:dolphin-mesh.png?id=jme3%3Aterminology"><img
|
|
|
+src="nbdocs:/com/jme3/gde/core/docs/jme3/dolphin-mesh.png" class="mediaright" align="right" alt="" /></a> Most visible objects in a 3D scene are made up of polygon meshes – characters, terrains, buildings, etc. A mesh is a grid-like structure that represents a complex shape. The advantage of a mesh is that it is mathematically simple enough to render in real time, and detailed enough to be recognizable.
|
|
|
+Every shape is reduced to a number of connected polygons, usually triangles; even round surfaces such as spheres are reduced to a grid of triangles. The polygons' corner points are called vertices. Every vertex is positioned at a coordinate, all vertices together describe the outline of the shape.
|
|
|
+You create 3D meshes in tools called mesh editors, e.g in Blender. <a
|
|
|
+href="/com/jme3/gde/core/docs/jme3/math.html">Learn more about 3D maths here.</a></p></div><h1><a
|
|
|
+name="materialscolor_lighting_shading">Materials: Color, Lighting/Shading</a></h1><div
|
|
|
+class="level1"><p> What we call "color" is merely part of an object's light reflection. The onlooker's brain uses shading and reflecting properties to infer an object's shape and material. Factors like these make all the difference between chalk vs milk, skin vs paper, water vs plastic, etc! (<a
|
|
|
+href="http://www.shaders.org/ifw2_textures/whatsin10.htm">External examples</a>)</p></div><h2><a
|
|
|
+name="color">Color</a></h2><div
|
|
|
+class="level2"></div><h3><a
|
|
|
+name="ambient_color">Ambient color</a></h3><div
|
|
|
+class="level3"><ul><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> The uniform base color of the mesh – what it looks like when not influenced by any light source.</div></li><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> Usually similar to the Diffuse color.</div></li><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> This is the minimum color you need for an object to be visible.</div></li></ul></div><h3><a
|
|
|
+name="diffuse_color">Diffuse color</a></h3><div
|
|
|
+class="level3"><ul><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> The base color of the mesh plus shattered light and shadows that are caused by a light source.</div></li><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> Usually similar to the Ambient color.</div></li></ul></div><h2><a
|
|
|
+name="light_sources">Light Sources</a></h2><div
|
|
|
+class="level2"></div><h3><a
|
|
|
+name="emissive_color">Emissive color</a></h3><div
|
|
|
+class="level3"><ul><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> The color of light emitted by a light source or glowing material.</div></li><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> Only glowing materials such as lights have an emissive color, normal objects don't have this property.</div></li><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> Often white (sun light).</div></li></ul></div><h2><a
|
|
|
+name="reflections">Reflections</a></h2><div
|
|
|
+class="level2"></div><h3><a
|
|
|
+name="shininess">Shininess</a></h3><div
|
|
|
+class="level3"><ul><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> Degree of shininess of a surface (0-128).</div></li><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> Shiny objects have small, clearly outlined specular highlights. (E.g. glass, water, silver)</div></li><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> Normal objects have wide, blurry specular highlights. (E.g. metal, plastic, stone, polished materials)</div></li><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> Uneven objects are not shiny and have no specular highlights. (E.g. cloth, paper, wood, snow)</div></li></ul></div><h3><a
|
|
|
+name="specular_color">Specular Color</a></h3><div
|
|
|
+class="level3"><ul><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> If the material is shiny, then the Specular Color is the color of the reflected highlights.</div></li><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> Usually the same as the emissive color of the light source (e.g. white).</div></li><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> You can use colors to achieve special specular effects, such as metallic or iridescent reflections.</div></li><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> Non-shiny objects don't use a specular color.</div></li></ul><p> <a
|
|
|
+href="/wiki/lib/exe/fetch.php?hash=08b76e&media=http%3A%2F%2Fimg823.imageshack.us%2Fimg823%2F1171%2Ftanlglow2.png"><img
|
|
|
+src="/wiki/lib/exe/fetch.php?hash=08b76e&w=400&h=234&media=http%3A%2F%2Fimg823.imageshack.us%2Fimg823%2F1171%2Ftanlglow2.png" class="mediacenter" alt="" width="400" height="234" /></a></p></div><h1><a
|
|
|
+name="materialstextures">Materials: Textures</a></h1><div
|
|
|
+class="level1"><p> Textures are part of Materials. In the simplest case, an object could have just one texture, the Color Map, loaded from one image file. When you think back of old computer games you'll remember this looks quite plain.
|
|
|
+The more information you (the game designer) provide additionally to the Color Map, the higher the degree of detail and realism. Whether you want photo-realistic rendering or "toon" rendering (Cel Shading), everything depends on the quality of your materials and texture maps. Modern 3D graphics use several layers of information to describe one material, each layer is a Texture Map.</p></div><h2><a
|
|
|
+name="texture_maps">Texture Maps</a></h2><div
|
|
|
+class="level2"></div><h3><a
|
|
|
+name="color_map">Color Map</a></h3><div
|
|
|
+class="level3"><p> <a
|
|
|
+href="/wiki/lib/exe/fetch.php?hash=b4d15a&media=http%3A%2F%2Fjmonkeyengine.googlecode.com%2Fsvn%2Ftrunk%2Fengine%2Fsrc%2Ftest-data%2FTextures%2FTerrain%2Fsplat%2Froad.jpg"><img
|
|
|
+src="/wiki/lib/exe/fetch.php?hash=b4d15a&w=64&h=64&media=http%3A%2F%2Fjmonkeyengine.googlecode.com%2Fsvn%2Ftrunk%2Fengine%2Fsrc%2Ftest-data%2FTextures%2FTerrain%2Fsplat%2Froad.jpg" class="mediaright" align="right" title="jmonkeyengine.googlecode.com_svn_trunk_engine_src_test-data_textures_terrain_splat_road.jpg" alt="jmonkeyengine.googlecode.com_svn_trunk_engine_src_test-data_textures_terrain_splat_road.jpg" width="64" height="64" /></a></p><ul><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> A simple image file (or a procedural texture).</div></li><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> The image can have alpha channels for transparency.</div></li><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> <strong>A color map is the minimum texture you need.</strong> All other texture maps are optional improvements.</div></li></ul></div><h3><a
|
|
|
+name="diffuse_map">Diffuse Map</a></h3><div
|
|
|
+class="level3"><p> <a
|
|
|
+href="/wiki/lib/exe/fetch.php?hash=f41169&media=http%3A%2F%2Fjmonkeyengine.googlecode.com%2Fsvn%2Ftrunk%2Fengine%2Fsrc%2Ftest-data%2FModels%2FHoverTank%2Ftank_diffuse.jpg"><img
|
|
|
+src="/wiki/lib/exe/fetch.php?hash=f41169&w=128&h=128&media=http%3A%2F%2Fjmonkeyengine.googlecode.com%2Fsvn%2Ftrunk%2Fengine%2Fsrc%2Ftest-data%2FModels%2FHoverTank%2Ftank_diffuse.jpg" class="mediaright" align="right" title="jmonkeyengine.googlecode.com_svn_trunk_engine_src_test-data_models_hovertank_tank_diffuse.jpg" alt="jmonkeyengine.googlecode.com_svn_trunk_engine_src_test-data_models_hovertank_tank_diffuse.jpg" width="128" height="128" /></a></p><ul><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> The Diffuse Map specifies the intensity of color.</div></li><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> Its basically the same as a Color Map but its called Diffuse Map in a lighting environment, as it defines the color the object "diffuses".</div></li></ul></div><h3><a
|
|
|
+name="bump_map">Bump Map</a></h3><div
|
|
|
+class="level3"><p> Bump maps are used to describe detailed shapes that would be too hard or simply too inefficient to sculpt in a mesh editor. You use Normal Maps to model cracks in walls, rust, skin texture, or a canvas weave. You use Height Maps to model whole terrains with valleys and mountains. <a
|
|
|
+href="/wiki/lib/exe/fetch.php?hash=e15227&media=http%3A%2F%2Fjmonkeyengine.googlecode.com%2Fsvn%2Ftrunk%2Fengine%2Fsrc%2Ftest-data%2FTextures%2FTerrain%2Fsplat%2Fmountains512.png"><img
|
|
|
+src="/wiki/lib/exe/fetch.php?hash=e15227&w=128&h=128&media=http%3A%2F%2Fjmonkeyengine.googlecode.com%2Fsvn%2Ftrunk%2Fengine%2Fsrc%2Ftest-data%2FTextures%2FTerrain%2Fsplat%2Fmountains512.png" class="mediaright" align="right" alt="" width="128" height="128" /></a></p></div><h4><a
|
|
|
+name="height_map">Height Map</a></h4><div
|
|
|
+class="level4"><ul><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> A height map is a grayscale image looking similar to a terrain map used in topography. Brighter grays represent higher areas and darker grays lower areas.</div></li><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> A heightmap can represent 256 height levels and is mostly used to roughly outline terrains.</div></li><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> You can draw a heightmap by hand in any image editor.</div></li></ul></div><h4><a
|
|
|
+name="normal_map">Normal Map</a></h4><div
|
|
|
+class="level4"><p> <a
|
|
|
+href="/wiki/lib/exe/fetch.php?hash=945484&media=http%3A%2F%2Fjmonkeyengine.googlecode.com%2Fsvn%2Ftrunk%2Fengine%2Fsrc%2Ftest-data%2FModels%2FHoverTank%2Ftank_normals.png"><img
|
|
|
+src="/wiki/lib/exe/fetch.php?hash=945484&w=128&h=128&media=http%3A%2F%2Fjmonkeyengine.googlecode.com%2Fsvn%2Ftrunk%2Fengine%2Fsrc%2Ftest-data%2FModels%2FHoverTank%2Ftank_normals.png" class="mediaright" align="right" alt="" width="128" height="128" /></a></p><ul><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> A well-done Normal Map makes a shape more detailed–without the need to add costly polygons to the mesh. It contains shading information that makes the object appear smoother and more fine-grained.</div></li><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> The Normal Map is displayed looking like a false-color version of the Color Map–but it is never used for coloring, instead, each RGB value encodes transformation data. This displacement data is represented by Surface Normals of the slopes, hence the name.</div></li><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> It's hard to draw normal maps by hand. Generally you use software tools to calculate them off 3D models.</div></li></ul></div><h3><a
|
|
|
+name="specular_map">Specular Map</a></h3><div
|
|
|
+class="level3"><p> <a
|
|
|
+href="/wiki/lib/exe/fetch.php?hash=789616&media=http%3A%2F%2Fjmonkeyengine.googlecode.com%2Fsvn%2Ftrunk%2Fengine%2Fsrc%2Ftest-data%2FModels%2FHoverTank%2Ftank_specular.jpg"><img
|
|
|
+src="/wiki/lib/exe/fetch.php?hash=789616&w=128&h=128&media=http%3A%2F%2Fjmonkeyengine.googlecode.com%2Fsvn%2Ftrunk%2Fengine%2Fsrc%2Ftest-data%2FModels%2FHoverTank%2Ftank_specular.jpg" class="mediaright" align="right" title="jmonkeyengine.googlecode.com_svn_trunk_engine_src_test-data_models_hovertank_tank_specular.jpg" alt="jmonkeyengine.googlecode.com_svn_trunk_engine_src_test-data_models_hovertank_tank_specular.jpg" width="128" height="128" /></a></p><ul><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> A Specular Map further improves the realism of an object's surface: It contains extra information about shininess and makes the shape appear more realistically illumated.</div></li><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> Start out with a gray value that corresponds to the average shininess/dullness of this material. Then add ligher grays for smoother, shinier, more reflective areas; and darker grays for duller, rougher, worn-out areas. The resulting image file looks similar to a grayscale version of the Color Map.</div></li><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> You can use colors in a specular map to create certain reflective effects (iridiscence, metallic).</div></li></ul></div><h2><a
|
|
|
+name="seamless_tiled_textures">Seamless Tiled Textures</a></h2><div
|
|
|
+class="level2"><p> <a
|
|
|
+href="/wiki/lib/exe/fetch.php?hash=5adfc8&media=http%3A%2F%2Fjmonkeyengine.googlecode.com%2Fsvn%2Ftrunk%2Fengine%2Fsrc%2Ftest-data%2FTextures%2FTerrain%2FBrickWall%2FBrickWall.jpg"><img
|
|
|
+src="/wiki/lib/exe/fetch.php?hash=5adfc8&w=128&h=128&media=http%3A%2F%2Fjmonkeyengine.googlecode.com%2Fsvn%2Ftrunk%2Fengine%2Fsrc%2Ftest-data%2FTextures%2FTerrain%2FBrickWall%2FBrickWall.jpg" class="mediaright" align="right" title="jmonkeyengine.googlecode.com_svn_trunk_engine_src_test-data_textures_terrain_brickwall_brickwall.jpg" alt="jmonkeyengine.googlecode.com_svn_trunk_engine_src_test-data_textures_terrain_brickwall_brickwall.jpg" width="128" height="128" /></a> This is a very simple, commonly used type of texture. When texturing a wide area (e.g. walls, floors), you don't create one huge texture, instead you tile a small texture repeatedly to fill the area.
|
|
|
+A seamless texture is an image file that has been designed so that it can be used as tiles: The right edge matches the left edge, and the top edge matches the bottom edge. The onlooker cannot easily tell where one starts and the next one ends, thus creating an illusion of a huge texture. The downside is that the tiling becomes painfully obvious when the area is viewed from a distance. Also you cannot use it on more complex models such as characters.</p></div><h2><a
|
|
|
+name="uv_maps">UV Maps</a></h2><div
|
|
|
+class="level2"><p> <a
|
|
|
+href="/wiki/lib/exe/fetch.php?hash=82332e&media=http%3A%2F%2Fjmonkeyengine.googlecode.com%2Fsvn%2Ftrunk%2Fengine%2Fsrc%2Ftest-data%2FModels%2FFerrari%2FCar.jpg"><img
|
|
|
+src="/wiki/lib/exe/fetch.php?hash=82332e&w=128&h=128&media=http%3A%2F%2Fjmonkeyengine.googlecode.com%2Fsvn%2Ftrunk%2Fengine%2Fsrc%2Ftest-data%2FModels%2FFerrari%2FCar.jpg" class="mediaright" align="right" title="jmonkeyengine.googlecode.com_svn_trunk_engine_src_test-data_models_ferrari_car.jpg" alt="jmonkeyengine.googlecode.com_svn_trunk_engine_src_test-data_models_ferrari_car.jpg" width="128" height="128" /></a> Creating a texture for a cube is easy – but what about a character with a face and extremities? For more complex objects, you design the texture in the same ways as a sewing pattern: One image file contains the outline of the front, back, and side of the object, next to one another. Specific areas of the flat texture (UV coordinates) map onto certain areas of your 3D model (XYZ coordinates), hence the name UV map.
|
|
|
+Getting the seams and mappings right is crucial: You will have to use a graphic tool like Blender to create UV Maps. It's worth the while to learn this, UV mapped models look a lot more professional.</p></div><h2><a
|
|
|
+name="environment_maps">Environment Maps</a></h2><div
|
|
|
+class="level2"><p> <a
|
|
|
+href="/wiki/lib/exe/fetch.php?hash=124408&media=http%3A%2F%2Fjmonkeyengine.org%2Fwp-content%2Fuploads%2F2010%2F10%2Fglass-teapot1.png"><img
|
|
|
+src="/wiki/lib/exe/fetch.php?hash=124408&w=160&h=90&media=http%3A%2F%2Fjmonkeyengine.org%2Fwp-content%2Fuploads%2F2010%2F10%2Fglass-teapot1.png" class="mediaright" align="right" alt="" width="160" height="90" /></a> Environment Maps are used to create the impression of reflections and refractions. You create a Cube Map to represent your environment, similar to a skybox. (Sphere Maps are possible, but often look too distorted.) You give the Cube Map a set of images showing a "360° view" of the completed scene. The renderer uses this as base to texture the reflective surface.
|
|
|
+Of course these reflections are static and not "real", e.g. the player will not see his avatar's face reflected, etc… But they cause the desired "glass/mirror/water" effect, and are fast enough to render in real usecases, it's better than nothing.</p></div><h2><a
|
|
|
+name="mip_map_texture">MIP Map Texture</a></h2><div
|
|
|
+class="level2"><p> You provide the texture in two or three resolutions to be stored in one file (MIP = "multum in parvo" = "many in one"). Depending on how close (or far) the camera is, the engine automatically renders a more (or less) detailed texture for the object. Thus objects look smooth from close up, but don't waste resources with unspottable details when far away. Good for everything, but requires more time to create and more space to store textures.</p></div><h2><a
|
|
|
+name="procedural_textures">Procedural Textures</a></h2><div
|
|
|
+class="level2"><p> A procedural texture is generated from repeating one small image, plus some pseudo-random, gradient variations (Perlin noise). Procedural textures look more natural than static rectangular textures, for instance, they look less distorted on spheres. On big meshes, their repetitiveness is much less noticable than tiled seamless textures. Procedural textures are ideal for irregular large-area textures like grass, soil, rock, rust, and walls. See also: <a
|
|
|
+href="http://jmonkeyengine.org/wiki/doku.php/jme3:jmonkeyplatform:neotexture">jMonkeyPlatform NeoTexture plugin</a> <a
|
|
|
+href="/wiki/lib/exe/fetch.php?hash=051bf1&media=http%3A%2F%2Fjmonkeyengine.org%2Fwp-content%2Fuploads%2F2010%2F10%2Fneotexture-2.jpg"><img
|
|
|
+src="/wiki/lib/exe/fetch.php?hash=051bf1&w=380&h=189&media=http%3A%2F%2Fjmonkeyengine.org%2Fwp-content%2Fuploads%2F2010%2F10%2Fneotexture-2.jpg" class="mediacenter" title="jmonkeyengine.org_wp-content_uploads_2010_10_neotexture-2.jpg" alt="jmonkeyengine.org_wp-content_uploads_2010_10_neotexture-2.jpg" width="380" height="189" /></a> See also: <a
|
|
|
+href="http://www.blender.org/education-help/tutorials/materials/">Creating Materials in Blender</a>, <a
|
|
|
+href="http://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro/Every_Material_Known_to_Man">Blender: Every Material Known to Man</a></p></div><h1><a
|
|
|
+name="animation">Animation</a></h1><div
|
|
|
+class="level1"><p> In 3D games, Skeletal Animation is used for animated characters, but in principle the skeleton approach can be extended to any 3D mesh (for example, an opening crate's hinge can be considered a joint).
|
|
|
+Unless you animate a 3D cartoon, realism of animated characters is generally a problem: Movement can look alien-like mechanical or broken, the character appears hollow, or as if floating. Professional game designers invest a lot of effort to make characters animate in a natural way (including motion capturing).</p></div><h2><a
|
|
|
+name="rigging_and_skinning">Rigging and Skinning</a></h2><div
|
|
|
+class="level2"><p> <a
|
|
|
+href="/wiki/lib/exe/fetch.php?hash=6038ee&media=http%3A%2F%2Fpub.admc.com%2Fmisc%2Fjme%2Fblenderjmetut%2Fblenderswordsman.png"><img
|
|
|
+src="/wiki/lib/exe/fetch.php?hash=6038ee&w=195&h=151&media=http%3A%2F%2Fpub.admc.com%2Fmisc%2Fjme%2Fblenderjmetut%2Fblenderswordsman.png" class="mediaright" align="right" alt="" width="195" height="151" /></a> An animated character has an armature: An internal skeleton (Bones) and an external surface (Skin). The Skin is the visible outside of the character and it includes clothing. The Bones are not visible and are used to interpolate (calculate) the morphing steps of the skin.
|
|
|
+JME3, the game engine, only loads and plays your recorded animations. You must use a tool (such as Blender) to set up (rig, skin, and animate) a character.</p><ol><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> <strong>Rigging:</strong> The Construction of a character's skeleton.</div><ul><li
|
|
|
+class="level2"><div
|
|
|
+class="li"> Create as few Bones as possible to decrease complexity.</div></li><li
|
|
|
+class="level2"><div
|
|
|
+class="li"> Bones are connected in a parent-child hierarchy: Moving one bone can pull another bone with it (e.g. arm pulls hand).</div></li><li
|
|
|
+class="level2"><div
|
|
|
+class="li"> Bones follow a certain naming scheme so the 3D engines know what's what.</div></li></ul></li><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> <strong>Skinning:</strong> The association of individual bones with the corresponding skin sections.</div><ul><li
|
|
|
+class="level2"><div
|
|
|
+class="li"> Each Bone is connected to a part of the Skin. Animating the (invisible) Bone pulls the (visible) Skin with it. <br/> E.g. the thigh Bone is connected to the upper leg Skin.</div></li><li
|
|
|
+class="level2"><div
|
|
|
+class="li"> One part of the Skin can be affected by more than one bone (e.g. knee, elbow).</div></li><li
|
|
|
+class="level2"><div
|
|
|
+class="li"> The connection between bones and skin sections is gradual: You assign weights how much each skin polygon is affected by any bone's motion. <br/> E.g. when the thigh bone moves, the leg is fully affected, the hips joints less so, and the head not at all.</div></li></ul></li><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> <strong>Keyframe Animation:</strong> A keyframe is one recorded snapshot of a motion sequence.</div><ul><li
|
|
|
+class="level2"><div
|
|
|
+class="li"> A series of keyframes makes up one animation.</div></li><li
|
|
|
+class="level2"><div
|
|
|
+class="li"> Each model can have several animations. Each animation has a name to identify it (e.g. "walk", "attack", "jump").</div></li><li
|
|
|
+class="level2"><div
|
|
|
+class="li"> You specify in your game code which keyframe animation to load, and when to play it.</div></li></ul></li></ol></div><h2><a
|
|
|
+name="kinematics">Kinematics</a></h2><div
|
|
|
+class="level2"><ul><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> Forward kinematics: "Given the angles of all the character's joints, what is the position of the character's hand?"</div></li><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> Inverse kinematics: "Given the position of the character's hand, what are the angles of all the character's joints?"</div></li></ul></div><h2><a
|
|
|
+name="controller_and_channel">Controller and Channel</a></h2><div
|
|
|
+class="level2"><p> In the JME3 application, you register animated models to the Animation Controller. The controller object gives you access to the available animation sequences. The controller has several channels, each channels can run one animation sequence at a time. To run several sequences, you create several channels, and run them in parallel.</p></div><h1><a
|
|
|
+name="artificial_intelligence_ai">Artificial Intelligence (AI)</a></h1><div
|
|
|
+class="level1"><p> Non-player (computer-controlled) characters (NPCs) are only fun in a game if they do not stupidly bump into walls, or blindly run into the line of fire. You want to make NPCs "aware" of their surroundings and let them make decisions based on the game state – otherwise the player can just ignore them. The most common use case is that you want to make enemies interact in a way so they offer a more interesting challenge for the player.
|
|
|
+"Smart" game elements are called artificially intelligent agents (AI agents). An AI agent can be an NPC, but also an "automatic alarm system" that locks doors after an intruder alert, or a trained pet.
|
|
|
+The domain of artificial intelligence deals, among other things, with:</p><ul><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> Knowledge – An agent only "knows" what it can "see and hear", this implies that things can be hidden from it. You can make a group of agents share knowledge (e.g. guards with two-way radios know, other guards don't know about the intruder).</div></li><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> Goal Planning – The agent has a priority to achieve a specific goal (a future state). It splits the goal into subgoals, determines tactics and strategies, and prioritizes them. The agent keeps testing whether the current state is closer to the (sub)goal. If unsuccessful, the agent changes the tactics/strategy. E.g. Finding the best path to reach a target in a changing environment.</div></li><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> Problem solving – The agent uses a given set of facts and rules to deduct what state it is in. In every state, only a certain subset of reactions makes sense. The actual decision depends on the agent's goal. Examples: If target in range, attack or protect base or raise alarm. If idle, lay traps or heal oneself or recharge ammunition. If floor on fire, then danger. If danger, escape or kamikaze.</div></li></ul><p> There are lots of resources explaining interesting AI algorithms:</p><ul><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> <a
|
|
|
+href="http://www.policyalmanac.org/games/aStarTutorial.htm">A* (A-Star) pathfinding for beginners</a></div></li><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> <a
|
|
|
+href="http://theory.stanford.edu/~amitp/GameProgramming/">A* (A-star) pathfinding theory</a></div></li><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> <a
|
|
|
+href="http://hem.fyristorg.com/dawnbringer/z-path.html">"Z-Path" algorithm</a> (backwards pathfinding)</div></li><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> <a
|
|
|
+href="http://web.media.mit.edu/~jorkin/goap.html">Goal-Oriented Action Planning</a></div></li><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> <a
|
|
|
+href="http://neuroph.sourceforge.net/">Java Neural Networks</a></div></li><li
|
|
|
+class="level1"><div
|
|
|
+class="li"> …</div></li></ul></div>
|
|
|
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:terminology?do=export_xhtmlbody">view online version</a></em></p>
|