Hi Martin,

If you follow the vertexexample closely then then rotation can be simply added (or removed because its already there) to TexMat in TexMatCallback. Look at R matrix in TexMatCallback::operator(). Multiply this R matrix by neccessary rotation. If you don't know what rotation exactly, try 90 or -90 degrees around X, Y, Z axes. After up to 6 tries you will find the one that best suits your need. And you will learn a lot ;-)

Wojtek

--------------------------------------------------
From: ""Martin Großer"" <[email protected]>
Sent: Tuesday, September 07, 2010 1:16 PM
To: "OpenSceneGraph Users" <[email protected]>
Subject: Re: [osg-users] How can I rotate a image

Ok, also I have create a sky box like the sky box in the vertexprogramm example of osg. But in my scene the up vector is in the z direction and not in the y direction. Now I have rotate my sky box 90 degrees around the x axis.

Is it understandable?

But now, the images on the sky box are in the wrong orientation. For example the image in the positiv x direction is 90 degrees rotated. And I want to correct this rotation.

Is it understandable? I am not sure.

Cheers

Martin

-------- Original-Nachricht --------
Datum: Tue, 7 Sep 2010 14:57:24 +0400
Von: "Trajce (Nick) Nikolov" <[email protected]>
An: OpenSceneGraph Users <[email protected]>
Betreff: Re: [osg-users] How can I rotate a image

what do you mean by "rotating an image"? Could you tell what you are
actually trying to do? More info you provide more chances to get some
advice

-Nick


2010/9/7 "Martin Großer" <[email protected]>

> Hello,
>
> I would like rotate a image. Because I want to rotate the separate
images
> from my sky box. I think it is difficult to change the texture
coordinates
> of my sphere. I my idea is to rotate the images at the beginning.
>
> Example
>
> ::osg::Image* image = osgDB::readImageFile(c_posX.Filename);
>
> // rotate image
>
> _cubeMap->setImage(::osg::TextureCubeMap::POSITIVE_X, image);
>
> I hope someone can help me.
>
> Cheers
>
> Martin
> --
> GMX DSL SOMMER-SPECIAL: Surf & Phone Flat 16.000 für nur 19,99
Euro/mtl.!*
> http://portal.gmx.net/de/go/dsl
> _______________________________________________
> osg-users mailing list
> [email protected]
>
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>

--
GMX DSL SOMMER-SPECIAL: Surf & Phone Flat 16.000 für nur 19,99 Euro/mtl.!*
http://portal.gmx.net/de/go/dsl
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to