How to achieve osg::Texture2D rotation 180?

17 views
Skip to first unread message

mirr...@gmail.com

unread,
Jan 19, 2021, 7:21:05 AM1/19/21
to OpenSceneGraph Users
win10  gtx1080  osg3.6.4 

osg::ref_ptr<osg::Image> image =
    osgDB::readImageFile( "picture.bmp" );
osg::ref_ptr<osg::Texture2D> texture = new osg::Texture2D;
texture->setImage( image.get() );

Voerman, L.

unread,
Jan 19, 2021, 9:32:48 AM1/19/21
to OpenSceneGraph Users, OpenSceneGraph Users
This should do a 180 rotation:
image->flipVertical();
image->flipHorizontal();
Laurens.


--
You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osg-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osg-users/5e38a08c-cf0a-4250-b5a3-61fd88eb7a06n%40googlegroups.com.
_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

mirr...@gmail.com

unread,
Jan 25, 2021, 2:38:59 AM1/25/21
to OpenSceneGraph Users
Thank you very much, but this method only works for four point texture coordinates  

Robert Osfield

unread,
Jan 25, 2021, 7:15:47 AM1/25/21
to OpenSceneGraph Users, OpenSceneGraph Users
On Mon, 25 Jan 2021 at 07:39, mirr...@gmail.com <mirr...@gmail.com> wrote:
Thank you very much, but this method only works for four point texture coordinates 

You provide so little information about the context about what you want to do folks are left guessing what might be appropriate.

For instance, are you wanting to physically modify the image data so it's rotation 180?

Or are you just wanting to modify the texture coordinates of your geometry so the texture appears 180 different?

How to do both are completely different.  Which is appropriate for your case we have no clue.
Reply all
Reply to author
Forward
0 new messages