Download SIMSCRIPT III 3d Graphics Manual
Transcript
Table of Contents Table of Contents................................................................................................................ 3 Preface................................................................................................................................. 5 1. Introduction................................................................................................................. 7 1.1 A Typical 3d Graphics Program ............................................................................... 8 1.2 Example code for a typical 3d graphics program ................................................... 10 1.3 Class hierarchy........................................................................................................ 12 2. The “scene-graph” ........................................................................................................ 14 2.1 The “3dworld” ........................................................................................................ 14 2.2 Setting the location of a node.................................................................................. 15 2.3 Setting the orientation of a node ............................................................................. 16 2.4 Shifting the position of a node ................................................................................ 17 2.5 Rotating a node ....................................................................................................... 17 2.4 Scaling a node ......................................................................................................... 18 2.5 Complete Scene-graph example ............................................................................. 18 3.1 Camera location and orientation ............................................................................. 22 3.2 Setting up the viewing plane................................................................................... 24 3.3 Adding a 3dcamera to the scene-graph................................................................... 25 3.4 Viewports and multiple cameras............................................................................. 26 3.5 Tracking a moving object with the 3dcamera......................................................... 27 4. Lighting up a scene-graph............................................................................................. 31 4.1 Determining the “variety” of lighting ..................................................................... 31 4.2 Ambient, Diffuse and Specular light ...................................................................... 32 4.3 Setting up the lighting using the 3dlight ................................................................. 34 5. Loading graphics files via Models................................................................................ 37 5.1 Reading in the 3dmodel from a file ........................................................................ 37 5.2 Linking a 3dmodel instance to a 3dnode instance .................................................. 37 5.4 Copying the scene-graph of a 3dmodel .................................................................. 38 5.5 Locating named sub-components ........................................................................... 39 5.6 Deriving from sub-components .............................................................................. 39 5.7 Misc. 3dmodel options............................................................................................ 43 6. Geometry....................................................................................................................... 45 6.1 Using the 3dgraphic class. ...................................................................................... 45 6.2 Surface geometry .................................................................................................... 46 6.4 Surface appearance ................................................................................................. 53 6.5 Surface texture mapping ......................................................................................... 54 6.6 Drawing points and lines ........................................................................................ 57 6.7: Drawing points....................................................................................................... 60 6.8 Text ......................................................................................................................... 62 Bitmapped fonts ........................................................................................................ 63 6.9 Updating the graphic............................................................................................... 65 6.8 Classes with retained geometry .............................................................................. 66 7. Surfaces, Textures and Materials.................................................................................. 67 7.1 Setting the color and shininess of a surface ............................................................ 67 7.2 Texture mapping and raster images ........................................................................ 68 3