Three.JS Walking Map
Structure of Core Objects
Scene Graph Objects
Scene
Mesh
Mesh(child)
Light
Camera
Flattened List
__webglObjects :Array
item :Object
item :Object
__lights :Array
item :Light
Geometry
Vertex
geometryGroups :Object(Hash)
Face3
or
Face4
geometryGroup :Object
WebGL objects
__webglFaceBuffer :WebGLBuffer
__webglVertexBuffer :WebGLBuffer
faces3 :Array
faces4 :Array
Material
Texture
Image(HTML)
WebGLProgram
Basic Rendering Sequence
Preparation Phase
[Setup
flattened list
] For each
scene graph object
:
Init matrices.
Create
geometry groups
corresponding to face
materials
.
[Setup buffers] For each
geometry group object:
Create WebGL buffers.
Create Non-WebGL buffers.
Add an
item
to
flattened list
.
Update buffers (Vertex buffer, Index buffer...).
Rendering Phase
Update matrices on
all of the descendants
of
scene
.
Set up
camera
matrices.
[Setup-loop] For each
flattened list item
:
Set up matrix.
Pick materials.
[Draw-loop] For each
flattened list item
:
Set up shader programs(and textures).
Prepare buffers.
Draw primitives