If there is a ball in the scene, we can create a sphere geometry to represent it; if there is a piece of paper on the table, we can use a rectangle geometry to model it. Geometries are the barebone of a scene: materials, lights, physical motions… are all built on top of geometries, they are basically the heart of a virtual world. We show some common types of geometries in the following sections to give you a rough idea how geometries are like in Photon renderer.
Rectangle, Triangle, and Sphere
These are common basic shapes to have in a renderer. They are useful for defining the shape of light sources or for further tessellation:
Triangle Mesh
Games, modeling programs, and other applications typically use triangle mesh to represent arbitrary 3-D shapes. It is basically a collection of triangles grouping in a way that approximate some shapes. Below is a famous model called Suzanne.
Cuboid
It is quite useful to have a generalized cube at hand. Unlike cubes, a cuboid allows variable extents. Cuboids are axis-aligned bounding boxes (AABB) in their local space.
A bonus to have cuboids is that voxel games like Minecraft can be rendered easily. Here is a work-in-progress render of a Minecraft level parser that tries to translate in-game data into SDL:
Miscellaneous
We support also some interesting geometries such as wave and fractals. A wave is basically a cuboid with its top surface being tessellated according to a superposition of 2-D sine and cosine functions. These special geometries are sometimes useful for modeling a scene.