Can 2D Images be rotated

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
adam23
Posts: 14
Joined: Fri Jun 16, 2006 6:37 pm
Contact:

Can 2D Images be rotated

Post 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.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post 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)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post 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
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
adam23
Posts: 14
Joined: Fri Jun 16, 2006 6:37 pm
Contact:

Post 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
adam23
Posts: 14
Joined: Fri Jun 16, 2006 6:37 pm
Contact:

Post 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.
Post Reply