Mirrored meshes?

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
madinitaly
Posts: 92
Joined: Sat Nov 29, 2003 8:30 pm
Contact:

Mirrored meshes?

Post by madinitaly »

I just noticed that .ms3d models result mirrored in my application. If I export the same models, without any modification in .md2 format they look right, but whenever I load a .ms3d model it will be horizontally flipped. (Applied textures are mirrored too).
Does it happen just to me?
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

Ah, hm, could be a bug. I only checked .ms3d files which were quite symetric. You could fix this bug temporarily by setting the scale of the mesh to (-1,1,1), I think.
madinitaly
Posts: 92
Joined: Sat Nov 29, 2003 8:30 pm
Contact:

Post by madinitaly »

Uhmm setting scale to negative values will flip the surfaces like a glove; anyway I'll just flip my textures or export my meshes to another format for now :P
Flo
Posts: 11
Joined: Mon Dec 01, 2003 2:03 pm
Location: Germany

Post by Flo »

i've got a similarly error ... when i load a .psd (or a .tga) file with "getTexture" and display it with "draw2DImage" then it would be mirrored ...
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

Could it have anything to do with Milkshape flipping the X and Y axis? I remember having all sorts of problems importing models from Milkshape to MAX.
madinitaly
Posts: 92
Joined: Sat Nov 29, 2003 8:30 pm
Contact:

* FIX *

Post by madinitaly »

Here is the code to (temporarily, I presume :P ) fix the mirroring bug:

Code: Select all

scene::IAnimatedMesh mymesh = smgr->getMesh ("mymesh.ms3d");

smgr->getMeshManipulator ()->flipSurfaces (mymesh->getMesh (0));

scene::IAnimatedMeshSceneNode mynode =
 smgr->addAnimatedMeshSceneNode (mymesh);

mynode->setScale (core::vector3df (-1, 1, 1));
:wink:
Post Reply