3DS file problem
3DS file problem
Hey guys,
I'm having a wierd problem. When i export 3ds models, and load them with the engine, not all of the polygons are rendered. This is a bit frustrating, as you might imagine, and i'd like some help
Thanks
Mike
I'm having a wierd problem. When i export 3ds models, and load them with the engine, not all of the polygons are rendered. This is a bit frustrating, as you might imagine, and i'd like some help
Thanks
Mike
96 C:\Downloads\irrlicht-0.14.0\irrlicht-0.14.0\examples\Mike's Try\main.cpp 'class irr::scene::IAnimatedMesh' has no member named 'setMaterialFlag'
heres the code
scene::IAnimatedMesh* mesh = smgr->getMesh("terrain.3ds");
scene::ISceneNode* node = 0;
node = smgr->addAnimatedMeshSceneNode(mesh);
node->setPosition(core::vector3df(0,0,0));
node->setMaterialTexture(0, driver->getTexture("log1.tga"));
node->getMaterial(0).EmissiveColor.set(0,0,0,0);
mesh->setMaterialFlag(EMF_BACK_FACE_CULLING, false);
heres the code
scene::IAnimatedMesh* mesh = smgr->getMesh("terrain.3ds");
scene::ISceneNode* node = 0;
node = smgr->addAnimatedMeshSceneNode(mesh);
node->setPosition(core::vector3df(0,0,0));
node->setMaterialTexture(0, driver->getTexture("log1.tga"));
node->getMaterial(0).EmissiveColor.set(0,0,0,0);
mesh->setMaterialFlag(EMF_BACK_FACE_CULLING, false);
-
- Posts: 131
- Joined: Fri Jun 03, 2005 7:26 pm
also use yourmeshnamehere->setMaterialFlag(EMT_NORMALIZE NORMALS,true);
and smgr->getMeshManipulator->flipsurfaces i think look in the irrlicht folder and look under doc open the irrlicht help and search mesh manipulaor in the index and it will explain. thats good help too!
and smgr->getMeshManipulator->flipsurfaces i think look in the irrlicht folder and look under doc open the irrlicht help and search mesh manipulaor in the index and it will explain. thats good help too!
"Held in Your arms but too far from my heart." "These thoughts will carry me through the darkest nights...while your eyes rest in mine."
"How quickly I forget that this is meaningless."
"How quickly I forget that this is meaningless."
-
- Posts: 131
- Joined: Fri Jun 03, 2005 7:26 pm
I have been working on a 3ds file conversion tool at work. I did some testing with the Irrlicht mesh viewer sample, and had some problems.
I hade downloaded sample cone, box and sphere 3ds files for testing. All opened fine in gmax/max and eventually my conversion tool. Only the box opened correctly when using the mesh viewer. For some reason the cone and the sphere were missing lots of vertex data. Turning on the debug boxes showed that the engine didn't believe the vertex data to be there.
I haven't had a chance to look at it, but I'm hoping to sometime this week.
Travis
I hade downloaded sample cone, box and sphere 3ds files for testing. All opened fine in gmax/max and eventually my conversion tool. Only the box opened correctly when using the mesh viewer. For some reason the cone and the sphere were missing lots of vertex data. Turning on the debug boxes showed that the engine didn't believe the vertex data to be there.
I haven't had a chance to look at it, but I'm hoping to sometime this week.
Travis
Hi,
I am getting the same problem with polygons missing from 3ds models. Looking at the engine source, I think the 3ds mesh file loader may not be calculating the correct number of faces, and changing the following line of code seems to have fixed the problem (for me, at least )
In C3DSMeshFileLoader.cpp, line 391:
change
to
CountIndices looks like the actual number of faces in the mesh, so surely it should not be divided by 3?
Anyway, I'm no expert with Irrlicht (yet) and I haven't tested this extensively but I hope this helps, providing you can rebuild the engine.
I am getting the same problem with polygons missing from 3ds models. Looking at the engine source, I think the 3ds mesh file loader may not be calculating the correct number of faces, and changing the following line of code seems to have fixed the problem (for me, at least )
In C3DSMeshFileLoader.cpp, line 391:
change
Code: Select all
group.faceCount = CountIndices / 3;
Code: Select all
group.faceCount = CountIndices;
Anyway, I'm no expert with Irrlicht (yet) and I haven't tested this extensively but I hope this helps, providing you can rebuild the engine.
-
- Posts: 370
- Joined: Mon Aug 29, 2005 10:54 pm
- Location: http://web.utk.edu/~pfox1
nomad wrote:Hi,
I am getting the same problem with polygons missing from 3ds models. Looking at the engine source, I think the 3ds mesh file loader may not be calculating the correct number of faces, and changing the following line of code seems to have fixed the problem (for me, at least )
In C3DSMeshFileLoader.cpp, line 391:
changetoCode: Select all
group.faceCount = CountIndices / 3;
CountIndices looks like the actual number of faces in the mesh, so surely it should not be divided by 3?Code: Select all
group.faceCount = CountIndices;
Anyway, I'm no expert with Irrlicht (yet) and I haven't tested this extensively but I hope this helps, providing you can rebuild the engine.
Where can i find "C3DSMeshFileLoader.cpp" ?
It is part of the Irrlicht source code. It would be in the source zip if you haven't extracted it.
If you make the change, you will need to recompile the Irrlicht library and put the .lib and .dll files in the correct places so that when you rebuild your application you'll get the changes and be able to debug them.
If you make the change, you will need to recompile the Irrlicht library and put the .lib and .dll files in the correct places so that when you rebuild your application you'll get the changes and be able to debug them.