1/31
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
Scene graph
A data structure that organizes the contents of a 3D scene using a hierarchical structure
Tree
Represents a hierarchical nature of structure in a graphical form
Nodes
A tree consists of elements called
Child nodes
The successor of a node
Parent nodes
The predecessor of a node
Root node
The tree’s topmost node
Model matrix
Effectively stores location, orientation, and scale of an object
Transform of the object
Location, orientation, and scale of an object collectively
World transformation
The transform of an object relative to the root of the scene graph
Scene graph structure
Allows simple geometric shapes to be grouped together into a compound object into a single unit
Scene graph-based framework
Allows you to create interactive scenes containing complex objects
corresponding class (ex. Object3D class) shall contain three (3) items
A matrix to store its transform data
A list of references to child objects
A reference to a parent object
Root node
(Scene)
Interior nodes used for grouping purposes
(Group)
Nodes corresponding to objects that can be rendered
(Mesh)
Virtual camera for rendering the point of view
(Camera)
Virtual light source that affects the shading and shadows
(Light)
The general shape and other vertex-related properties of each mesh
(Geometry)
The general appearance of an object
(Material)
The general initialization tasks and image rendering
(Renderer)
Vertex array object (VAO)
associates vertex buffers to attribute variables/ allows geometric objects to be reused
vertex-related properties of each mesh (ex. Geometry class)
shall store Attribute objects that describe vertex properties, such as position and color
Geometric objects
shall also store texture coordinates, for applying images to shapes, and normal vectors, for use in lighting calculations
In some cases, such as rectangles and boxes
the attribute data shall be listed directly.
For other shapes, such as polygons, cylinders, and spheres
the attribute data shall be calculated from mathematical formulas.
the general appearance of an object (ex. Material class) shall serve as a repository for three types of information related to the rendering process and the appearance of an object
the shader code (and the associated program reference),
Uniform objects, and
render settings
The render settings
are the properties which are set by calling functions, such as the type of geometric primitive s (points, lines, or triangles), point size, line width, and so forth.
The base Material class
shall initialize dictionaries to store uniform objects and render setting data. It shall also define functions to perform tasks such as compiling the shader program code and locating uniform variable references. Extensions of this class shall supply the actual shader code, a collection of uniform objects corresponding to uniform variables defined in the shaders, and a collection of render setting variables applicable to the type of geometric primitive being rendered.
The rendering function in the Renderer class shall require two ( 2 ) parameters
a scene object and
a camera object
For each mesh in the scene graph, the renderer shall perform the tasks necessary before the function for drawing is called
These tasks include activating the correct shader program, binding a vertex array object, configuring render settings, and sending values to be used in uniform variables
There are three ( 3 ) required uniform variables by most shaders whose values are stored outside the material
the transformation of a mesh,
the transformation of the virtual camera used for viewing the scene, and
the perspective transformation applied to all objects in the scene
Though the uniform objects will be stored in the material for consistency
this matrix data shall be copied by the rendered into the corresponding uniform objects before they send their values to the GPU.