Page 1 of 1

2d Sprite movment!

Posted: Thu Nov 24, 2005 1:33 pm
by FAT_BOT
How would i go about doing this?

Posted: Thu Nov 24, 2005 1:51 pm
by Guest
you could do it in several ways:

first way: http://irrlicht.sourceforge.net/tut006.html

or better way (and thats the way i suggest you): use flat 3d objects (a flat rectangle) and make a 2d view out of a 3d camera (disable Z). then apply your sprite as a texture to the flat object and turn off mipmapping. that way you have 3D that looks like perfect 2D but you have the advantage of:

1. i think its a lot faster (more fps)
2. you can move, scale, rotate, blend, color and even more (which could not be done with the 2D elements or way harder)
3. you can have different layers of sprites more easier
4. the camera handling is easier, too
5. i dont think its harder than real 2D, i even think that its easier

as you see, 3D -> 2D seems to be the better way.

if you choose way 1, you have to set the coordinates of the sprite yourself (rect<int>(startx, starty, endx, endy))

if you choose way 2, you just have to call: YourSprite->setPosition(vector3df position)


its your decision :)

re:

Posted: Thu Nov 24, 2005 1:51 pm
by Conquistador
Search function.

Tutorials.

Go nuts.

Posted: Thu Nov 24, 2005 6:04 pm
by bitplane
...and lets not be forgetting Emil's 2d sprite class-
http://www.irrforge.org/index.php/Playi ... h_Irrlicht

Posted: Thu Nov 24, 2005 6:08 pm
by Guest
i think emils class is basically the thing i was talking about (3D as 2D) so its a good idea to take a look at it and get yourself an idea on how to do it.

if you do not like custom scene nodes or you dont understand them, dont worry, you can do it without them, too :)

Posted: Tue Mar 13, 2007 7:06 pm
by Dandrolvorn
Hello ;)

The link to irrforge is down, has anyone another link to this class?

greets Dandro