render animated flat object

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
kilnan
Posts: 7
Joined: Thu Apr 02, 2009 9:42 pm

render animated flat object

Post by kilnan »

hi

I'm pretty noob and i could not find a solution to this problem:

I'd like to render flat objects using 3d rendering ,II don't want use 2d rendering because I want be able to spin those objects in 3d and I want those things to be in fact part of the scene..

so those objects should look like 2d sprites in a 3d environment...Ok it's a little odd.. if anyone has ever played any of paper mario then it should be clear
http://www.youtube.com/watch?v=HajjMFjdzPg
but in fact it was used often in early 3d games

so I need to make a polygon with a texture which supports transparency and which can be changed dynamically, is it possible to do this through irrlicht?

thanks a lot
olivehehe_03
Posts: 157
Joined: Tue Mar 20, 2007 8:30 am

Post by olivehehe_03 »

Yeah this is definately possible, I was doing something kinda similar for a bit in one of my projects.

The way I did it was I make a quick 3d model of a flat plane (simpler for me to do it this way rather than doing it manually through Irrlicht) and got my textures (which I had in .png format so they have an alpha channel to use for transparency) and just loaded the model and put the texture on it. The only slightly tricky thing I had to do was set the material type of the 3D node to EMT_TRANSPARENT_ALPHA_CHANNEL so it would do transparency based on my textures alpha channel and I experimented with SMaterial::MaterialTypeParam to make it smoother around the edges.

After that I could just move the node around like anything else. as well as that, if you wanted to you could experiment with a Billboard scene node for anything that needs to be facing the camera rather than having to set that up yourself. Hope that helps a bit
Tell me what you cherish most. Give me the pleasure of taking it away.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

I don't know if it is the effect you are going for or not, but you could use the method matrix4::buildShadowMatrix() which builds a transformation matrix that flattens geometry onto a plane. You could use this to render a 3d object onto a plane.

Travis
grumpymonkey
Posts: 222
Joined: Mon Jan 19, 2009 10:03 pm
Location: Miami, Florida
Contact:

Post by grumpymonkey »

this is easy, all you have to do is get a flat square model with both sides visible, and UV map it so the the front of it has the front of your character, and the back has the back of it(as a texture).Next thing you should do is find out how to make transparent textures.
Image
Post Reply