position of a b3d mesh

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
diogoecomp
Posts: 30
Joined: Thu Jun 11, 2009 3:36 am

position of a b3d mesh

Post by diogoecomp »

hello,
I need some help (again :roll: ) of you guys about a b3d model that I'm trying to use. A friend of mine made the model using Blender and exported it using Gandalf's exporter. The problem is when I load it in Irrlicht. As you can see on the picture, the model is half under the floor (wich position is 0,0,0). Is there any special configuration in the model so it won't act like that?
I already tried to move the center (that point in the center of the model) to the feet, but it didn't work, and if I use the ninja model provided with Irrlicht (and the same code), it works fine.

Image
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

while in blender, you just move the whole model up above the grid it should work.
diogoecomp
Posts: 30
Joined: Thu Jun 11, 2009 3:36 am

Post by diogoecomp »

Well, he tried that and it didn't solve the problem. The model can be downloaded here, so if anyone could test it I would be grateful.

frames:
1-38 ->idle
50-90-> walk

Thanks.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

is there a reason why you don't just set the Y-position in Irrlicht ??? :shock:
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

i haven't try your files, but i'm using blender with gandalf's exporter but mine works, though. i didn't mean move the pivot point but the whole model.
diogoecomp
Posts: 30
Joined: Thu Jun 11, 2009 3:36 am

Post by diogoecomp »

Acky,
I need to use a lot of different models and I don't want to have to set the Y-position to every model. If there is a certain configuration that I need to do so my models just have to be loaded and will be at the right position, that's what I want to know. But, as my time is running out, I think I will do that 8)

Virion,
I tried to move the pivot and the whole model but it didn't work. Moving the blend model 2x its height above the grid gave me a change on its Y-position, inside Irrlicht, equivalent to the size of the model hand. :?

thanks
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

How do you place your model? Usually when the model-feet are at 0 in Blender then the center of the model should also be 0 in Irrlicht. Well, at least it worked that way for me so far...

Do you use the animator for placement or do you set the model manually?
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

CuteAlien wrote:Well, at least it worked that way for me so far...
yeah mine works too. strange.
diogoecomp
Posts: 30
Joined: Thu Jun 11, 2009 3:36 am

Post by diogoecomp »

I have a list of positions like the one below and I use the following code to set the model positions:

Code: Select all

void moveTo(IAnimatedMeshSceneNode* node, vector3df finalPosition)
{
        vector3df actualPosition;
        actualPosition = node->getPosition();
        posDiff = finalPosition - actualPosition;
        posDiff.normalize();
        degree = atan2(posDiff.X,posDiff.Z) * core::RADTODEG;
        node->setRotation(vector3df(0,degree,0));

        node->setPosition(finalPosition);
}
The list os positions is like this:

1.350000 0.000000 1.720000
1.340000 0.000000 1.760000
1.340000 0.000000 1.800000
1.370000 0.000000 1.820000
1.390000 0.000000 1.850000
1.390000 0.000000 1.900000

I'm using the same list of positions to create a motion trail using drawVertexPrimitiveList and the trails are at Y=0, on the floor.

thanks for your help! :wink:
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Can you also put the .blend file online? But maybe just try it once more. Move the whole model up in blender until the feet are at 0 and then export once more.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
diogoecomp
Posts: 30
Joined: Thu Jun 11, 2009 3:36 am

Post by diogoecomp »

you can download the blend model here.

and thanks again for your help. :wink:
frr171
Posts: 4
Joined: Sat Jan 02, 2010 10:17 pm
Location: Chandler Arizona
Contact:

Post by frr171 »

I think it might work if you move up all of the vertices in edit mode in blender. Most exporters don't apply object transforms to model data.
Post Reply