exporting mesh/texture to .3ds and into irrlicht

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
millhouse
Posts: 3
Joined: Wed Nov 07, 2007 1:33 am

exporting mesh/texture to .3ds and into irrlicht

Post by millhouse »

I am really new at this and I am using blender to make a model of planet earth. I create a UVsphere mesh, mark a seam down the center and unwrap its UV faces. I load in a .bmp as a texture and set it to sphere under the map input tab. It looks great in Blender rendered.

When I export to .3ds and load it into irrlicht the texture is only on about half of the sphere and it is also not scaled like it was in blender. For example, on the half that shows textured the tip of South America takes up about half of the space and Antartica takes up the rest.

Here is my code:

IAnimatedMesh* animMesh = mgr->getMesh("media/planet.3ds");

IMeshManipulator* manipulator = mgr->getMeshManipulator();
IMesh* planetMesh = manipulator->createMeshCopy(animMesh->getMesh(0));

matrix4 m;
m.setScale (core::vector3df(100,100,100));
manipulator->transformMesh(planetMesh, m);

node = mgr->addMeshSceneNode(planetMesh);
node->setPosition(position);
Cardinal4
Posts: 97
Joined: Sun Jun 11, 2006 1:20 am
Location: SG
Contact:

Post by Cardinal4 »

You could try using IrrEdit too if you're on Windows to see if your mesh loads properly inside of Irrlicht. That way you would have no doubts about whether it's your code or your mesh that is incorrect.

Is your texture's dimensions to the power of two? (512, 256, 128)

btw, map to sphere or map to flat doesn't matter, since you've UV wrapped it.
Sketches of a rambling mind
Still a long way on learning Irrlicht...
millhouse
Posts: 3
Joined: Wed Nov 07, 2007 1:33 am

Post by millhouse »

I'll try irredit and see what I get.

My .bmp is 512 X 256. Do the deimensions have to be the same?
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

millhouse wrote:My .bmp is 512 X 256. Do the deimensions have to be the same?
no, it doesn't matter as far as the dimensions are in power of 2 (2^n), so 512 x 256 is perfect ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
millhouse
Posts: 3
Joined: Wed Nov 07, 2007 1:33 am

Post by millhouse »

I tried to load it into Irredit and it looks horrible, just like it does in Irrlicht. I tried creating a sphere in Irredit and applying the texture to that sphere and it looks great. Is there a way to export that sphere so that I can use it in Irrlicht?

Thanks in advance!
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Use addSphereSceneNode to get the sphere
lester
Posts: 86
Joined: Mon Jan 29, 2007 3:33 pm

Post by lester »

there was the similar problem for me once. See blender uses it's own UV mapping mechanism and to correct export to 3ds you have to click on the TexFaces button in the material properties and switch to UV in the Texture mapping tab.
Post Reply