How to rotate 2D texture?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
StargateSG1
Posts: 15
Joined: Sun Aug 22, 2004 2:06 pm
Location: Estonia

How to rotate 2D texture?

Post by StargateSG1 »

How do I rotate a 2D texture? I looked in the docs but couldn't find any functions for that.
knightoflight
Posts: 199
Joined: Sun Aug 24, 2003 5:47 pm
Location: Germany

Post by knightoflight »

Hi, theres a thread from nebukadnezzar with some good functions to change textures, i think for example the fliptexture you can change to rotate ?
http://irrlicht.sourceforge.net/phpBB2/ ... ight=#3628
StargateSG1
Posts: 15
Joined: Sun Aug 22, 2004 2:06 pm
Location: Estonia

Post by StargateSG1 »

Too bad... I have no idea how to make the FlipTexture() to rotate the texture by a give degree :?

But is there some way to do it with the help of 3D. I mean something like draw a cube and apply a texture to it. And then how do I rotate the cube?
knightoflight
Posts: 199
Joined: Sun Aug 24, 2003 5:47 pm
Location: Germany

Post by knightoflight »

ok, if you want to rotate not only in 90-steps its not easy, yes.

The cube-node you rotate with
node->setRotation(core::vector3df(a,b,c));

but what do you want to rotate a texture or a node ? What are you programming ?
StargateSG1
Posts: 15
Joined: Sun Aug 22, 2004 2:06 pm
Location: Estonia

Post by StargateSG1 »

Well I am thinking of creating a top down game like GTA1 or GTA2. And the rotation is necessary for cars and human.

I thought it would be easier to draw everything as textures first and later(as a second project) create the whole game world as a 3D.

But if there are no texture rotating functions then I'll start it 3D. Both ways are fun anyway :P
knightoflight
Posts: 199
Joined: Sun Aug 24, 2003 5:47 pm
Location: Germany

Post by knightoflight »

yes many things are in irrlicht-3D easier than in 2D. Thats an example, yes.
And the cool thing is, in 3d you easy change camera down to street and youre in GTA3 or Vice City. And take a car...
StargateSG1
Posts: 15
Joined: Sun Aug 22, 2004 2:06 pm
Location: Estonia

Post by StargateSG1 »

Now that's a cool idea 8)
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

there is no way to rotate texture. you would need to do it pixel by pixel which would be too slow.

Normaly you use animated sprite to make your 2d objects rotate.
Post Reply