- Timestamp:
- 09/15/10 14:00:12 (3 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osggeometry/osggeometry.cpp
r10741 r11763 38 38 #include <iostream> 39 39 40 // This demo s uses the illustrates how to createsthe various different types of geometry that41 // the osg::Geometry class can represent. This demo s uses the OpenGL red booksdiagram of different40 // This demo illustrates how to create the various different types of geometry that 41 // the osg::Geometry class can represent. This demo uses the OpenGL red book diagram of different 42 42 // OpenGL Primitives as a template for all the equivalent OpenSceneGraph Primitives. The OpenSceneGraph 43 // wraps OpenGL very thinly souses all the same enum and naming conventions. The coordinate data is also43 // wraps OpenGL very thinly and therefore uses all the same enum and naming conventions. The coordinate data is also 44 44 // wrapped around OpenGL's vertex arrays and draw arrays/elements calls. Familiarity with 45 // OpenGL will help understand thethe osg::Geometry class which encapsulate all this, or if you45 // OpenGL will help you understand the osg::Geometry class which encapsulate all this, or if you 46 46 // havn't learned OpenGL yet, learning osg::Geometry will help you understand how OpenGL 47 47 // works! … … 85 85 osg::Geode* geode = new osg::Geode(); 86 86 87 // follow sare separate blocks for creating POINTS, LINES, LINE_STRIP, LINE_LOOP, POLYGON, QUADS,88 // QUAD_STRIP, TRIANGLES, TRIANGLE_STRIP and TRIANGLE_FAN primitives. Aimage of these primitives89 // are provided in the distribution: OpenSceneGraph-Data/Images/primitives.gif.87 // following are separate blocks for creating POINTS, LINES, LINE_STRIP, LINE_LOOP, POLYGON, QUADS, 88 // QUAD_STRIP, TRIANGLES, TRIANGLE_STRIP and TRIANGLE_FAN primitives. An image of these primitives 89 // is provided in the distribution: OpenSceneGraph-Data/Images/primitives.gif. 90 90 91 91 … … 298 298 299 299 // Note on vertex ordering. 300 // While the OpenGL diagram should vertices specified in a clockwise direction301 // in reality you need to specify coords for polygons intoa anticlockwise direction302 // for their front face to be pointing towards you r,get this wrong and you could300 // According to the OpenGL diagram vertices should be specified in a clockwise direction. 301 // In reality you need to specify coords for polygons in a anticlockwise direction 302 // for their front face to be pointing towards you; get this wrong and you could 303 303 // find back face culling removing the wrong faces of your models. The OpenGL diagram 304 // is just plain wrong, but it snice diagram so we'll keep it for now!304 // is just plain wrong, but it's a nice diagram so we'll keep it for now! 305 305 306 306 // create POLYGON … … 309 309 osg::Geometry* polyGeom = new osg::Geometry(); 310 310 311 // this time we'll aC arrays to initialize the vertices.311 // this time we'll use C arrays to initialize the vertices. 312 312 // note, anticlockwise ordering. 313 // note II, OpenGL polygons must be convex planpolygons, otherwise313 // note II, OpenGL polygons must be convex, planar polygons, otherwise 314 314 // undefined results will occur. If you have concave polygons or ones 315 315 // that cross over themselves then use the osgUtil::Tessellator to fix … … 530 530 531 531 532 // define a node callback to animat iona transform as a cycle along the y axis, between 0 and 2.0.532 // define a node callback to animate a transform as a cycle along the y axis, between 0 and 2.0. 533 533 class MyTransformCallback : public osg::NodeCallback 534 534 {
