Cosmo 3D is a new toolkit that brings 3D graphics programming to desktop applications. Cosmo 3D is a scene graph API; its concepts are new, but similar to concepts developed in Open Inventor, Performer, and OpenGL.
This guide shows you how to develop Cosmo 3D applications. Included are descriptions of Cosmo 3D applications that you can run on your workstation, as well as code examples that you can use as a guide when developing your Cosmo 3D applications.
This guide presents the developer's view of the Cosmo 3D's C++ library with C++ examples.
This guide presents information about Cosmo 3D in a task-oriented manner: the topics in this guide are arranged to coincide with the order in which you need to refer to them while writing a Cosmo 3D application. To illustrate the use of Cosmo 3D, code examples are sprinkled throughout the guide. Additional sample source code is provided in the /usr/share/optimizer/cosmo1.1/cosmo/test/C++ directory.
Brief descriptions of the chapters in this guide follow:
Chapter 1, “Getting Started with Cosmo 3D,” provides an overview of Cosmo 3D, introduces some of its most basic classes, and lists the steps involved in creating a typical application.
Chapter 2, “Creating Geometries,” discusses large, ready-made geometries, such as csSphere and csCube objects, and explains how to use the csGeoSet-derived classes provided by Cosmo 3D and how to create your own csGeoSet-derived classes.
Chapter 3, “Specifying the Appearance of Geometries,” describes the appearance fields in csContext and csAppearance.
Chapter 4, “Scene Graph Nodes,” describes nodes and node types.
Chapter 5, “Building a Scene Graph,” describes how to build and edit a scene graph.
Chapter 6, “Placing Shapes in a Scene,” describes how to place shapes in scenes.
Chapter 7, “Traversing the Scene Graph,” describes how an action traverses a scene graph and a description of the actions available in Cosmo 3D.
Chapter 8, “Lighting and Fog,” describes how to use lights, change the shadow modeling, and change the screen to one color. It also discusses fog, a new feature in Cosmo 3D 1.1.
Chapter 9, “Viewing the Scene,” describes how to set up the viewport and how to use cameras to view a scene.
Chapter 10, “Scene Graph Engines,” describes csEngine and the multiple subclasses derived from it.
Chapter 11, “Sensors,” explains how to implement sensors. Sensors are used to detect time passing and ointer device events.
Chapter 12, “User Interface Mechanisms,” discusses how to implement user interaction using X window code, csWindow, and selection mechanisms.
Chapter 13, “Multiprocessing,” describes how to implement multiprocessing.
Chapter 14, “Optimizing Rendering,” describes the Cosmo 3D nodes and programming techniques that can help optimize your application's performance.
Chapter 15, “Adding Sounds To Virtual Worlds,” describes how to set and play sound using Cosmo 3D.
Appendix A, “Cosmo Basic Types,” discusses all of the basic types that are used in other Cosmo 3D classes.
Appendix B, “Cosmo 3D Sample Application,” lists a complete sample application and explains its components.
Appendix C, “Cosmo 3D Class Hierarchy,” shows the class hierarcy in Cosmo 3D.
These chapters and appendices are followed by an index.
Reference pages for Cosmo 3D are obtained by pointing your web browser at:
For IRIX: /usr/share/Optimizer/doc/developer
For Windows: <inst_dir>/doc/developer
Where inst_dir is the directory where Optimizer was installed. The default installation location is <system_drive>:/Progral Files/Silicon Graphics/Optimizer.
This guide is written for developers of OpenGL Optimizer applications. Developers use Cosmo 3D scene graph nodes and actions to develop OpenGL Optimizer applications.
This guide is written with the assumption that the reader is experienced with C++.
For information on Open Inventor, see the following:
Wernecke, Josie, The Inventor Mentor. Reading, Mass.:Addison Wesley 1994
Wernecke, Josie, The Inventor Toolmaker. Reading, Mass.:Addison Wesley 1994
Open Inventor Architecture Group, Open Inventor C++ Reference Manual. Reading, Mass.:Addison Wesley 1994
OpenGL Architecture Review Board, M. Woo, J. Neider, and Tom Davis, OpenGL Programming Guide, Second Edition, 1997. (Also known as “the Red book.”)
For information on OpenGL Optimizer; see the following SGI manual:
OpenGL Optimizer Programmer's Guide: An Open API for Large-Model Visualization (document number 007-2852-002).
These style conventions are used in this guide:
Bold—Functions, class names, node names, data members, and data types
Italics—Variables, filenames, spatial dimensions, and commands
Regular—Program names and enumerated types
Code examples are set off from the text in a fixed-space font.