ABSTRACT

Graphics frameworks often use a scene graph, which organizes the contents of a three-dimensional scene using a hierarchical or tree-like data structure. Beginning with this structure, this chapter introduces additional terms in computer graphics, such as a scene, camera, and mesh, and demonstrates how these concepts may be realized in code. Classes are created that generate geometric data for a variety of shapes, such as rectangles, boxes, polygons, spheres, and cylinders. Supporting classes enable this data to be rendered as collections of points, lines, or triangulated surfaces. Extra features added to the framework include mesh representations of coordinate axes and grids, to help the viewer to have a sense of orientation and scale within a scene, and a movement rig, to help the viewer interact with the scene, by moving the camera or other objects with a natural keyboard-based control scheme.