Ignore:
Timestamp:
Jun 30, 2012, 8:56:16 PM (12 years ago)
Author:
Torben Dannhauer
Message:

vertex- and texcoord warping works now :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • experimental/distortionNG/extViewer.cpp

    r392 r394  
    100100    osg::Vec3 dy = yAxis*(height/((float)(rows-1)));
    101101
    102 
    103102        // Create vertices and coordinates
    104103        osg::Vec3Array* vertices = new osg::Vec3Array;
     
    112111                for ( unsigned int col=0; col<columns; col++ )
    113112                {
     113                        osg::Vec3 vertex = origin+dy*row+dx*col;
     114
    114115                        // Create coordinates of the mesh node (geometry).
    115                         vertices->push_back( origin+dy*row+dx*col );
    116 
    117                         // Create tex coordinates
    118                         osg::Vec2 texcoord = osg::Vec2((float)col/(float)(columns-1), (float)row/(float)(rows-1));
     116                        vertices->push_back( vertex );
    119117
    120118                        // Set Coordinates for RTT-Texture (scene rendering)
    121                         texcoords0->push_back( texcoord );
     119                        texcoords0->push_back( osg::Vec2( vertex.x(), vertex.y()) );
    122120
    123121                        // Set Color of the mesh node
Note: See TracChangeset for help on using the changeset viewer.