Page 1 of 1

How to get access to wheels in vehicle model

Posted: Tue Apr 12, 2011 9:58 pm
by blackMasoon
Hello. I have a problem with accessing to a vehicle mesh wheels. I have a obj vehicle file which should have wheels as children and I can't access them f. ex. to rotate the wheels. In other engine there was an example of accessing wheels by getting children nodes of the mesh. In Irrlicht getJointCount() or getChildren().getSize() returns 0. How can I access those wheels?

Here's the example in min3D engine based on open GL ES:
http://www.rozengain.com/blog/2010/05/1 ... r-android/


It's the same mesh.

Posted: Tue Apr 12, 2011 10:04 pm
by Lonesome Ducky
OBJ cannot store skeletal information, so getJointCount will always return 0. Instead of making the separate parts of the mesh into children, irrlicht makes them separate meshbuffers. I'd recommend just keeping them separate all together and setting them as children in the engine.

Posted: Tue Apr 12, 2011 10:08 pm
by blackMasoon
But even irrEdit shows one wheel in the (0,0,0) position, so it means that there should exist a way to access those wheels in irrlicht in this file.... It seems like these are few separate objects in one obj file so my question is howto access them?

Posted: Tue Apr 12, 2011 10:58 pm
by Lonesome Ducky
Like I said above, they're put into separate meshbuffers (they're in the same mesh, meshes contain usually quite a few mesh buffers). You can access the meshbuffers individually and transform them

Posted: Wed Apr 13, 2011 8:48 am
by hybrid
Since rotatin ghte wheel most often does not require to change the geometry, it would even be enough to alter the texture matrix of the wheels' materials.

Posted: Wed Apr 13, 2011 2:55 pm
by blackMasoon
Well... I can't do anything with texture 'cause there is one for whole model (including wheels).

And next bad news is... that the getMeshBufferCount() returns 1 so it looks like there is no access to those wheels from there...

Posted: Wed Apr 13, 2011 4:07 pm
by hybrid
Well, usually things are put into groups when exported to .obj. Since the loader seems to ingore the groups for now, you could set the scene parameter such that the groups are correctly loaded into separate mesh buffers. If there are even no groups in the file, you're completely lost with this mesh.
Even if you only have one texture, you can still use texture matrix, as it works per mesh buffer. But separate meshbuffers are a must.

Posted: Thu Apr 14, 2011 8:32 am
by nespa
make the wheels as separate meshes (separated 3D models) and then make them as children of the vehicle mesh.

Posted: Fri May 27, 2011 4:05 am
by zester
Even better would be to make the tires and the rims separate meshes. Parent the rims to the
car and the tires to the rims then have your tires rotate fast in one direction and your rims
rotate slow in the opposite direction. And wahala your gangster with spinners!!!! lol

And cue the music...
http://www.youtube.com/watch?v=ip0vsLelVYY