2d Sprite movment!
2d Sprite movment!
How would i go about doing this?
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
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
-
- Posts: 340
- Joined: Wed Sep 28, 2005 4:38 pm
- Location: Canada, Eh!
re:
Search function.
Tutorials.
Go nuts.
Tutorials.
Go nuts.
...and lets not be forgetting Emil's 2d sprite class-
http://www.irrforge.org/index.php/Playi ... h_Irrlicht
http://www.irrforge.org/index.php/Playi ... h_Irrlicht
-
- Posts: 15
- Joined: Thu Apr 20, 2006 4:31 pm