position of a b3d mesh
-
- Posts: 30
- Joined: Thu Jun 11, 2009 3:36 am
position of a b3d mesh
hello,
I need some help (again ) 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.
I need some help (again ) 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.
while in blender, you just move the whole model up above the grid it should work.
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
-
- Posts: 30
- Joined: Thu Jun 11, 2009 3:36 am
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.
frames:
1-38 ->idle
50-90-> walk
Thanks.
is there a reason why you don't just set the Y-position in Irrlicht ???
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
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.
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
-
- Posts: 30
- Joined: Thu Jun 11, 2009 3:36 am
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
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
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
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
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?
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
yeah mine works too. strange.CuteAlien wrote:Well, at least it worked that way for me so far...
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
-
- Posts: 30
- Joined: Thu Jun 11, 2009 3:36 am
I have a list of positions like the one below and I use the following code to set the model positions:
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!
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);
}
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!
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
-
- Posts: 30
- Joined: Thu Jun 11, 2009 3:36 am