Show
Ignore:
Timestamp:
09/15/10 14:00:12 (4 years ago)
Author:
robert
Message:

From Magnus Kessler, "Attached are a number of files where I have tried to fix up some of the
documentation. I have accumulated them over some time, but rebased onto the
subversion trunk."

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osggeometry/osggeometry.cpp

    r10741 r11763  
    3838#include <iostream> 
    3939 
    40 // This demos uses the illustrates how to creates the various different types of geometry that 
    41 // the osg::Geometry class can represent.  This demos uses the OpenGL red books diagram of different  
     40// 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  
    4242// OpenGL Primitives as a template for all the equivalent OpenSceneGraph Primitives.  The OpenSceneGraph  
    43 // wraps OpenGL very thinly so uses all the same enum and naming conventions. The coordinate data is also  
     43// wraps OpenGL very thinly and therefore uses all the same enum and naming conventions. The coordinate data is also  
    4444// wrapped around OpenGL's vertex arrays and draw arrays/elements calls.  Familiarity with 
    45 // OpenGL will help understand the the osg::Geometry class which encapsulate all this, or if you 
     45// OpenGL will help you understand the osg::Geometry class which encapsulate all this, or if you 
    4646// havn't learned OpenGL yet, learning osg::Geometry will help you understand how OpenGL 
    4747// works! 
     
    8585    osg::Geode* geode = new osg::Geode(); 
    8686 
    87     // follows are separate blocks for creating POINTS, LINES, LINE_STRIP, LINE_LOOP, POLYGON, QUADS, 
    88     // QUAD_STRIP, TRIANGLES, TRIANGLE_STRIP and TRIANGLE_FAN primitives.  A image of these primitives 
    89     // 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. 
    9090 
    9191 
     
    298298 
    299299    // Note on vertex ordering. 
    300     // While the OpenGL diagram should vertices specified in a clockwise direction 
    301     // in reality you need to specify coords for polygons into a anticlockwise direction 
    302     // for their front face to be pointing towards your, get this wrong and you could 
     300    // 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 
    303303    // find back face culling removing the wrong faces of your models.  The OpenGL diagram  
    304     // is just plain wrong, but its nice 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! 
    305305 
    306306    // create POLYGON 
     
    309309        osg::Geometry* polyGeom = new osg::Geometry(); 
    310310         
    311         // this time we'll a C arrays to initialize the vertices. 
     311        // this time we'll use C arrays to initialize the vertices. 
    312312        // note, anticlockwise ordering. 
    313         // note II, OpenGL polygons must be convex plan polygons, otherwise  
     313        // note II, OpenGL polygons must be convex, planar polygons, otherwise  
    314314        // undefined results will occur.  If you have concave polygons or ones 
    315315        // that cross over themselves then use the osgUtil::Tessellator to fix 
     
    530530 
    531531 
    532 // define a node callback to animation a 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. 
    533533class MyTransformCallback : public osg::NodeCallback 
    534534{