Deformed mesh. (D3D9, .x)

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.
RaymondH
Posts: 8
Joined: Thu Aug 05, 2010 9:42 pm

Deformed mesh. (D3D9, .x)

Post by RaymondH »

Code: Select all

IAnimatedMeshSceneNode* Character;
Character = pManager->getSceneManager()->addAnimatedMeshSceneNode(
		pManager->getSceneManager()->getMesh("SimpleMan.x"));
pManager->getSceneManager() is equal to device->getSceneManager()

The reason why its an IAnimatedMeshSceneNode is because I want to be able to get the JointNode and attach a child mesh in the feature.

The problem:
Image
As you can see, the mesh is completely deformed. Something that might be interesting to know is that this mesh has bones.

How it looks in blender:
Image

Any idea? Need more information?


Thanks,

Raymond
DarkDepths
Posts: 126
Joined: Sun Apr 02, 2006 1:21 am
Location: Canada

Post by DarkDepths »

I guess the first thing I would try is re-exporting the mesh, only this time without bones, and seeing if the problem is still there. I suspect it wouldn't be, but confirmation would be good.
RaymondH
Posts: 8
Joined: Thu Aug 05, 2010 9:42 pm

Post by RaymondH »

DarkDepths wrote:I guess the first thing I would try is re-exporting the mesh, only this time without bones, and seeing if the problem is still there. I suspect it wouldn't be, but confirmation would be good.
Thanks for the tip. Without the bones the mesh looks better. But, without bones irrlicht gives the following error: Too many vertices for 16bit index type, render artifacts may occur. And they occur.

With the bones, it does not give this error.
Bate
Posts: 364
Joined: Sun Nov 01, 2009 11:39 pm
Location: Germany

Post by Bate »

Doesn't look like more than 65536 vertices unless the sphere is way too detailed. You didn't insanely crank up the faces on the sphere, did you? :)
Last edited by Bate on Thu Aug 05, 2010 11:02 pm, edited 1 time in total.
Never take advice from someone who likes to give advice, so take my advice and don't take it.
RaymondH
Posts: 8
Joined: Thu Aug 05, 2010 9:42 pm

Post by RaymondH »

Bate wrote:Doesn't look like more than 65536 vertices unless the sphere is way too detailed :)
Whole model:
4.5k verticles
4.5k faces
DarkDepths
Posts: 126
Joined: Sun Apr 02, 2006 1:21 am
Location: Canada

Post by DarkDepths »

RaymondH wrote:
Bate wrote:Doesn't look like more than 65536 vertices unless the sphere is way too detailed :)
Sphere:
4.5k verticles
4.5k faces
:shock:

4.5 k faces on a sphere...

That is WAY too many for a sphere...

Usually, when I make a sphere, I give it a maximum of 48 triangles.

I think it would be in your best interest to recreate this model in a lower-polygonal fashion...

I'm not sure it will help with your deformations, but it will save you a lot of computing power!
Bate
Posts: 364
Joined: Sun Nov 01, 2009 11:39 pm
Location: Germany

Post by Bate »

Did you try loading it in Irrlicht's MeshViewer? If not do so and look at the values shown there.
Never take advice from someone who likes to give advice, so take my advice and don't take it.
RaymondH
Posts: 8
Joined: Thu Aug 05, 2010 9:42 pm

Post by RaymondH »

Bate wrote:Did you try loading it in Irrlicht's MeshViewer? If not do so and look at the values shown there.
Loaded the model into the meshviewer, any specific value you are interested in?
DarkDepths wrote:
RaymondH wrote:
Bate wrote:Doesn't look like more than 65536 vertices unless the sphere is way too detailed :)
Sphere:
4.5k verticles
4.5k faces
:shock:

4.5 k faces on a sphere...

That is WAY too many for a sphere...

Usually, when I make a sphere, I give it a maximum of 48 triangles.

I think it would be in your best interest to recreate this model in a lower-polygonal fashion...

I'm not sure it will help with your deformations, but it will save you a lot of computing power!
Renamed 'Sphere' to 'Whole model'. A little miscommunication between me and the graphic artist. He also made a character out of boxes and bones 5 minutes ago. Same problem as this character. So the problem must be something else. And bold text looks good ehhh :)
Last edited by RaymondH on Thu Aug 05, 2010 11:36 pm, edited 3 times in total.
Bate
Posts: 364
Joined: Sun Nov 01, 2009 11:39 pm
Location: Germany

Post by Bate »

triangle count while the model is completely visible.
Last edited by Bate on Thu Aug 05, 2010 11:39 pm, edited 2 times in total.
Never take advice from someone who likes to give advice, so take my advice and don't take it.
RaymondH
Posts: 8
Joined: Thu Aug 05, 2010 9:42 pm

Post by RaymondH »

Bate wrote:triangle count, while the model is completely visible
Tris stands for triangle count?
Ifso, the value is 18348.
DarkDepths
Posts: 126
Joined: Sun Apr 02, 2006 1:21 am
Location: Canada

Post by DarkDepths »

RaymondH wrote: Renamed 'Sphere' to 'Whole model'. A little miscommunication between me and the graphic artist. He also made a character out of boxes and bones 5 minutes ago. Same problem as this character. So the problem must be something else.
Even still, for that specific model, 4.5k poly's is quite high. To illustrate, look at this model I just quickly whipped up:

Image

Guess how many polygons...

646.

I know at this point it is a little off topic, but really, I think you would benefit from optimizing your model a bit.

As far as the deformation goes, I'm sorry, I can't help, so I'll stop filling up your thread with unrelated stuff, good-luck!
Bate
Posts: 364
Joined: Sun Nov 01, 2009 11:39 pm
Location: Germany

Post by Bate »

Yeah, then it's more of an exporting issue. Though it's weird because the error message appears to be wrong. Unfortunately, I can't help you with Blender since I'm not using it. (DarkDepths is right btw :))
Never take advice from someone who likes to give advice, so take my advice and don't take it.
RaymondH
Posts: 8
Joined: Thu Aug 05, 2010 9:42 pm

Post by RaymondH »

I'm happy with all the information I get. So thanks for that!
stefbuet
Competition winner
Posts: 495
Joined: Sun Dec 09, 2007 4:13 pm
Location: france

Post by stefbuet »

I use to have same deformation with the .X exporter I was using with 3dsmax (panda exporter). If I remember well, the problem was with bones position/rotation exportation. It had 2 options : export transformation matrix, or export absolution xyz value, one of those option made deformations like your model have, the other was fine (I don't remember which of those was the good one).
RaymondH
Posts: 8
Joined: Thu Aug 05, 2010 9:42 pm

Post by RaymondH »

stefbuet wrote:I use to have same deformation with the .X exporter I was using with 3dsmax (panda exporter). If I remember well, the problem was with bones position/rotation exportation. It had 2 options : export transformation matrix, or export absolution xyz value, one of those option made deformations like your model have, the other was fine (I don't remember which of those was the good one).
Great tip!

The graphic artist moved the middle of the model to 0,0,0 within blender and made a new export. This export renders succesfully using irrlicht.

Irrlicht does come up with a new error:
Unexpected ending found in Frame in x file.
Line: 46

Code: Select all

Mesh {
328;
-0.885700; 1.000000; -1.000000;,
-0.885700; -1.000000; -1.000000;,
-2.885700; -1.000000; -1.000000;,
-2.885700; 1.000000; -1.000000;,
Where the last line is line 46

Probably something we will have to fix ourselves :p
Post Reply