Animate part of a mesh [solved]

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
alc
Posts: 31
Joined: Sun Jun 25, 2006 10:59 pm
Location: Denmark

Animate part of a mesh [solved]

Post by alc »

I have a mesh of a wind turbine that I found on the web, and now I want the rotor to rotate. According to the site that I found it on it is not animated, so I have to rotate it myself. Now, the mesh contains 5 meshbuffers according to IMesh::getMeshBufferCount(), and I thinking that one or two or these might be the rotor blades and hub. So now I want to apply an animator to part of the mesh, but dispite trying various things I have not succeded in separating the mesh into two meshes and making them into scene nodes. Any clues how to do this? I have the mesh in both 3ds and obj format.
Last edited by alc on Sun Mar 07, 2010 11:15 pm, edited 1 time in total.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

I guess you'll have to split the mesh into 2 seperate meshes with an 3d-editor... ;)
Last edited by Acki on Sun Mar 07, 2010 11:25 pm, edited 1 time in total.
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

2d editor? Probably not... Anyway, if you are sure that a whole meshbuffer is just the rotor you can simply get that meshbuffer and add it to a new SMesh (simply add it, not cloning or anything like that). Do the same for a new SMesh for all the other buffers in order to get rid of the rotor from the base mesh as well. Then add the rotation animator to the first mesh.
If you have a rotor modelled as a flat plane with a 2d texture on it, it would be much simpler by just altering the texture matrix of that meshbuffer.
alc
Posts: 31
Joined: Sun Jun 25, 2006 10:59 pm
Location: Denmark

Post by alc »

Thanx hybrid. Worked like a charm.

Anyone doing this trick, remember to recalculateBoundingBox() on your SMesh, otherwise you may get strange effects from the reduced-sized mesh.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

hybrid wrote:2d editor? Probably not...
<rofl> just a typo... ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Post Reply