Ignore:
Timestamp:
Jun 16, 2012, 1:57:23 PM (12 years ago)
Author:
Torben Dannhauer
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • experimental/distortionNG/DistortionSetupStrategyProjectSyntropy.cpp

    r384 r387  
    387387                                for(int col=0;col<distortionMeshColumns;col++)
    388388                                {
    389                                         float x=col/distortionMeshColumns;      // Vertex X
    390                                         float y=row/distortionMeshRows;         // Vertex Y
    391                                         float z=col/distortionMeshColumns;      // TexCoord X
    392                                         float w=row/distortionMeshRows;         // TexCoord Y
    393                                         if(_distortionType==VERTEXDISTORTION || _distortionType==COMBINEDDISTORTION)
     389                                        float x=(float)col/(float)(distortionMeshColumns-1);    // Vertex X
     390                                        float y=(float)row/(float)(distortionMeshRows-1);               // Vertex Y
     391                                        float z=(float)col/(float)(distortionMeshColumns-1);    // TexCoord X
     392                                        float w=(float)row/(float)(distortionMeshRows-1);               // TexCoord Y
     393
     394        /*                              if(_distortionType==VERTEXDISTORTION || _distortionType==COMBINEDDISTORTION)
    394395                                        {
    395396                                                x = vertexMeshVec2->at(row*col).x();
     
    400401                                                z = texCoordMeshVec2->at(row*col).x();
    401402                                                w = texCoordMeshVec2->at(row*col).y();
    402                                         }
     403                                        }*/
    403404
    404405                                        distortionMesh->at(row*distortionMeshColumns+col).set(x,y,z,w);
    405406                                }
    406407                        }
     408
     409                        for (osg::Vec4Array::iterator it = distortionMesh->begin(); it != distortionMesh->end(); ++it)
     410                        {
     411                                OSG_ALWAYS<<"final vector: "<<(*it).x()<<" "<<(*it).y()<<" "<<(*it).z()<<" "<<(*it).w()<<std::endl;
     412                        }
     413
    407414
    408415                        distortionSet->setDistortionMesh(distortionMesh);
Note: See TracChangeset for help on using the changeset viewer.