Game Development Reference
In-Depth Information
Models classification
The geometric models in CycleBlob can be divided into three categories.
Static “artistic” models that are simply moved around in the scene and are not manipulated in any
way. The player bike and the bonus ball are such models. In a well-funded game produced by a
game studio, such models are usually created by 3D-modelling artists. In the case of CycleBlob, I
used the Google SketchUp 3D repository to find these models.
Dynamic models that are generated purely in JavaScript code at runtime. The wall trail behind the
bikes and the explosion effect are such models. The JavaScript code of the game explicitly
generates the arrays of data for these meshes in real time. These models are changed and
updated in almost every single frame to account for the movement of the bikes and the progress
of time.
Static models that go through some geometric processing before being displayed in 3D. The
model of the 3D world on which the game is played (“the grid”) is such a model.
The following sections describe each of these in detail.
Static models
Before being displayed to the user, the models first need to find their way to the user's browser. Since
models can be rather big at times, this is most conveniently achieved using XMLHttpRequest transfers after
the page has loaded—to avoid having the user wait for a long time before anything is displayed.
3D models come in various shapes and formats: from complex scenes that include lighting, camera
positions, and animation produced with an editor-like Autodesk 3ds Max, to simple objects that don't
include much more than a triangle mesh definition. One popular format for such simple meshes is the
wavefront .obj format. 1 This simple textual format is widely supported by 3D editors and viewers, which
can export or convert files to it.
The tetrahedron example in the .obj format looks like this:
v 1.0 -1.0 -1.0
v -1.0 1.0 -1.0
v -1.0 -1.0 1.0
v 1.0 1.0 1.0
f 2 3 4
f 1 3 2
f 4 3 1
f 1 2 4
1 For more information, visit http://en.wikipedia.org/wiki/Wavefront_.obj_file .
 
Search WWH ::




Custom Search