Page 1 of 1

Can 2D Images be rotated

Posted: Thu Jun 22, 2006 10:15 pm
by adam23
I can't find a whole lot of information on 2D images. I am hoping to make a simple Tetris game using the engine so for each piece I would like the ability to rotate it. Does anyone know a solution to this?

Thanks in advance.

Posted: Fri Jun 23, 2006 12:37 am
by Acki
Well, rotating a 2d image is not supported by Irrlicht, yet...
You could write your own rotating functions as you have direct access to the bitmap data with lock() and unlock()...

For Tetris you may have a look at my site, I wrote IrrTris (source included) !!! 8)

Posted: Fri Jun 23, 2006 12:56 am
by bitplane
see this example for drawing 2d rotating sprites (irrforge.org is currently down, hence the need for google cached version)
http://64.233.161.104/search?q=cache:9U ... =clnk&cd=2

Posted: Fri Jun 23, 2006 3:02 am
by adam23
Acki wrote:Well, rotating a 2d image is not supported by Irrlicht, yet...
You could write your own rotating functions as you have direct access to the bitmap data with lock() and unlock()...

For Tetris you may have a look at my site, I wrote IrrTris (source included) !!! 8)
Thanks for the reply, that might just be a good challenge for me to try and figure out a way to rotate 2d images. I couldn't get your site to work, I'm not sure it may be my ISP because I've had problems in the past. If you wouldn't mind (you don't have to) emailing me the source code I would really appreciate it. adam_autum@iwon.com

Thanks again

Posted: Fri Jun 23, 2006 3:04 am
by adam23
bitplane wrote:see this example for drawing 2d rotating sprites (irrforge.org is currently down, hence the need for google cached version)
http://64.233.161.104/search?q=cache:9U ... =clnk&cd=2
Thank you for the link, it really helps explain a lot of features of the engine. I was going to use that method, but I was hoping their was a smoother way to rotate a bitmap. I am now thinking about rendering the texture to a cube and rotating that. Do you think that would work? I believe I saw somewhere about rotating 3d cubes.