diff --git a/examples/osgmovie/osgmovie.cpp b/examples/osgmovie/osgmovie.cpp index 369cc34a5..10ccaf62b 100644 --- a/examples/osgmovie/osgmovie.cpp +++ b/examples/osgmovie/osgmovie.cpp @@ -526,8 +526,8 @@ int main(int argc, char** argv) { osg::notify(osg::NOTICE)<<"image->s()"<s()<<" image-t()="<t()<<" aspectRatio="<getPixelAspectRatio()<s(); - float height = image->t() * image->getPixelAspectRatio(); + float width = image->s() * image->getPixelAspectRatio(); + float height = image->t(); osg::ref_ptr drawable = myCreateTexturedQuadGeometry(pos, width, height,image, useTextureRectangle, xyPlane, flip); diff --git a/include/osg/Image b/include/osg/Image index f82a9a01d..07b81a297 100644 --- a/include/osg/Image +++ b/include/osg/Image @@ -186,7 +186,10 @@ class OSG_EXPORT Image : public Object void setPacking(unsigned int packing) { _packing = packing; } inline unsigned int getPacking() const { return _packing; } + /** Set the pixel aspect ratio, defined as the pixel width divided by the pixel height.*/ inline void setPixelAspectRatio(float pixelAspectRatio) { _pixelAspectRatio = pixelAspectRatio; } + + /** Get the pixel aspect ratio.*/ inline float getPixelAspectRatio() const { return _pixelAspectRatio; } /** Return the number of bits required for each pixel. */