Show
Ignore:
Timestamp:
06/12/07 18:55:44 (8 years ago)
Author:
robert
Message:

Added Image::g/setOrigin to help movie plugins tell applications that the imagery
is not the usual OpenGL BOTTOM_LEFT orientation, but with the origin TOP_LEFT. This
allows geometry setup code to flip the t tex coord to render the movie the correct way up.

Files:
1 modified

Legend:

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

    r6941 r6947  
    269269osg::Geometry* myCreateTexturedQuadGeometry(const osg::Vec3& pos,float width,float height, osg::Image* image, bool useTextureRectangle) 
    270270{ 
     271    bool flip = image->getOrigin()==osg::Image::TOP_LEFT; 
    271272    if (useTextureRectangle) 
    272273    { 
     
    274275                                           osg::Vec3(width,0.0f,0.0f), 
    275276                                           osg::Vec3(0.0f,0.0f,height), 
    276                                            0.0f,image->t(), image->s(),0.0f); 
     277                                           0.0f, flip ? image->t() : 0.0, image->s(), flip ? 0.0 : image->t()); 
    277278 
    278279        osg::TextureRectangle* texture = new osg::TextureRectangle(image); 
     
    292293                                           osg::Vec3(width,0.0f,0.0f), 
    293294                                           osg::Vec3(0.0f,0.0f,height), 
    294                                            0.0f,1.0f, 1.0f,0.0f); 
     295                                           0.0f, flip ? 1.0f : 0.0f , 1.0f, flip ? 0.0f : 1.0f); 
    295296                                     
    296297        osg::Texture2D* texture = new osg::Texture2D(image);