110 likes | 327 Views
Mathematical Concepts. Math Topic: Rotation Interpolation. Interpolating between two 3D orientations can be mathematically complex. Traditional Approach Define the object’s orientation by means of rotations about the three coordinate axes (i.e., roll, pitch, yaw).
E N D
Mathematical Concepts Math Topic: Rotation Interpolation Interpolating between two 3D orientations can be mathematically complex. Traditional Approach Define the object’s orientation by means of rotations about the three coordinate axes (i.e., roll, pitch, yaw) Problem: “Gimbal lock” in which rotation about one axis can override rotation about another Common Approach Specify an axis and the rotation about that axis (used in OpenGL) Problem: Animated interpolation does not appear smooth Fancy Approach Essentially, specify a “look-at” vector, supplemented with a roll value (i.e., quaternions) Problem: Rather complicated mathematics, using an extension of complex analysis Part 4.1: Mathematical Concepts Page 107
Math Topic: Fractals Many rendered objects have self-similarity, i.e., when magnified, their details are graphically similar to the objects as a whole. Note how commonly rendered polyhedral objects don’t have this self-similar quality. Part 4.1: Mathematical Concepts Page 108
Fractal Generation Numerous mathematical and statistical techniques have been discovered to yield self-similar images when they’re applied to graphical rendering. L-Systems (Lindenmayer): Primitive Geometric Models The Koch Snowflake (above), formed by splitting equilateral triangles. The Twin Dragon Tile (below), which shifts alternating strips in alternating directions. Part 4.1: Mathematical Concepts Page 109
Fractal Terrains In games, fractals are commonly used to generate terrains, often with a 2D grid recursively subdivided with random heights generated at each progressive grid point. By color-coding different heights, a realistic terrain is produced. In games, the resulting image is sometimes used as a bitmap for texture-mapping. Part 4.1: Mathematical Concepts Page 110
Regular, concentric-circle wood pattern Brownian motion turbulence function Scaled sum texture Texture mapped to toroidal object Math Topic: Procedural Texturing with Noise Random number generation can also be used to generate procedural textures, which can add a photorealistic look to object surfaces. As the turbulence function becomes more complex, the textured image improves, but the processing time increases. Part 4.1: Mathematical Concepts Page 111
Collision Detection and Resolution Since seeing objects pass through each other when they collide can be quite jarring to the game player, detecting collisions and responding to them in a visually acceptable manner is crucial. Some collision detection approaches: • Actual triangle intersections • Bounding boxes, spheres, etc. • BSP separation planes • Dead reckoning Once a collision is detected, an appropriate response must be generated. Bouncing? Breaking? Bending? Blending? Part 4.2: Collision Detection and Resolution Page 112
Real-Time Game Physics One Goal in Games: Physical Reality (Within Reason) To maximize the player’s immersion in a game, it’s important to model the physics of the game environment as accurately as possible. Even abstract games that don’t simulate the “real” world (e.g., Tetris) have their own physics model that makes gameplay understandable. Some of the desirable physics features that should be modeled in games: • Gravity • Collisions • Friction • Fluid dynamics Part 4.3: Real-Time Game Physics Page 113
Physics Topic: Domain-Specific Dynamics Customized physics engines that accommodate specific simulated environments (e.g., flight simulators) can focus on that environment’s physical constraints, rather than modeling all of reality. Example: Car Simulators Desirable modeling: • Torque • Suspension • Skid Marks • Tire Heating • Wheel constraints • Fuel consumption • Road Conditions Part 4.3: Real-Time Game Physics Page 114
Physics Topic: Rigid-Body Dynamics Solid objects are the most common type of objects in a game (they’re easiest to model). It’s important to render their animation accurately, taking into account mass, momentum, friction, and elasticity. Part 4.3: Real-Time Game Physics Page 115
Physics Topic: Continuum Dynamics Draping Cloth Constrained Chain Clothing in Motion Elastic Blob Fluid Surface Part 4.3: Real-Time Game Physics Page 116
Physics Engines for Games While commercial and open source physics engines facilitate the incorporation of physics features into games, developers still need a basic understanding of the physics in order to properly use the engines. Part 4.3: Real-Time Game Physics Page 117