 | [TOC] Chapter 3: Meshes and Models |  |
 | Introduction |  |
We assume that a world is composed of objects. We need to model the following properties of each object:
• its location - where is an object in reference to the scene?
• its orientation - which way is the object turned or facing?
• its volume - what 3-dimensional space does the object take up?
• its surface properties - what color is the object? Is the object smooth or rough?
Our description of the world must be in mathematical values, symbols and operations that a computer is capable of manipulating. This means you need to understand some math! But don't let the math scare you. The math will be introduced slowly with plenty of explanations and examples. Just make sure you fully understand one topic before proceeding to the next. The math is more easily understood in 2-dimensions, so we will introduce the ideas in 2-dimensional space and then extend them to 3-dimensional space.
So let's start with the basics of location and build from there...
 | Model Location |  |
In WebGPU, positioning models in a scene involves defining their locations in 3D space. The way objects are positioned, translated, or manipulated in relation to other objects is a core aspect of working with 3D rendering.
Location Is Relative
In 3D graphics, positions are often relative to a particular coordinate system. This means that objects are located based on a parent object’s position or a global coordinate system. For example, the position of a model relative to the world origin (0, 0, 0) could be different when viewed relative to the camera’s position.
Example: Relative Position
If a model is placed at coordinates (2, 0, 0) relative to the world origin, and then the world origin shifts, the model’s relative position may remain unchanged, but its absolute position will be different from the viewer’s perspective.
|