Changeset 319 for experimental


Ignore:
Timestamp:
Sep 8, 2011, 7:19:51 PM (13 years ago)
Author:
Torben Dannhauer
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • experimental/distortionNG/extViewer.cpp

    r318 r319  
    187187        geom->getOrCreateStateSet()->setMode(GL_CULL_FACE, osg::StateAttribute::OFF | osg::StateAttribute::PROTECTED);
    188188
    189         for ( unsigned int row=0; row<rows; ++row )
     189        for ( unsigned int row=0; row<rows; row++ )
    190190        {
    191                 for ( unsigned int col=0; col<columns; ++col )
     191                for ( unsigned int col=0; col<columns; col++ )
    192192                {
    193193                        vertices->push_back( origin+dy*row+dx*col );
     
    223223 //   geometry->addPrimitiveSet(elements);
    224224
    225         for ( unsigned int row=0; row<rows; ++row )
     225        for ( unsigned int row=0; row<rows-1; row++ )   // each strip consists of two affected vertex rows, so we need only row-1 strips.
    226226        {
    227                 osg::ref_ptr<osg::DrawElementsUInt> de = new osg::DrawElementsUInt(GL_QUAD_STRIP, columns*2);
    228                 for ( unsigned int col=0; col<columns; ++col )
     227                osg::ref_ptr<osg::DrawElementsUInt> de = new osg::DrawElementsUInt(GL_QUAD_STRIP, columns*2);   // columns*2 = number of involved vertices for this strip.
     228                for ( unsigned int col=0; col<columns; col++ )
    229229                {
    230230                        (*de)[col*2 + 0] = row*columns + col;
Note: See TracChangeset for help on using the changeset viewer.