Game Development Reference
In-Depth Information
3D Graphics Rendering
The graphics hardware inside the average smartphone is now capable of rendering
3D graphics of a surprisingly high quality for a device that is small enough to fit into
your pocket.
The Marmalade SDK makes using 3D graphics in your own games extremely easy to
do, as you will discover when we cover the following topics in this very chapter:
• The basics of 3D graphics rendering—projection, clipping, lighting, and so on
• Creating and rendering a simple 3D model entirely in code
• Exporting 3D model data from a modeling package
• Loading exported 3D models into memory and rendering them
A quick 3D graphics primer
Before we get our hands dirty with rendering code, let's just touch on some of the
basics of how 3D rendering can be achieved. If you already have a good handle of
3D rendering techniques then feel free to skip this section.
Describing a 3D model
In computer graphics a 3D representation of an object is often referred to as a model .
When we build a model in three dimensions for use in a video game, we create a
group of triangles that define the shape of the model. We can also use quadrilaterals
to make the modeling process easier, but these ultimately get converted into two
triangles when it comes to rendering time.
The simplest representation of a 3D model is therefore little more than a big list of
vertices which define the triangles required to render the model, but we often specify
a host of extra information so we can control exactly how the model should appear
on screen.
Search WWH ::




Custom Search