problems with rendering a mesh

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
Lemming
Posts: 3
Joined: Fri Feb 03, 2006 8:30 pm

problems with rendering a mesh

Post by Lemming »

hey guys Im new on irrlicht...
Im trying to create a tetris clone at the moment. but I got problems with rendering the level-mesh.

heres my code:

Code: Select all

// Camera initialization
	m_pCamera = g_pIrrSmgr->addCameraSceneNode(NULL, irr::core::vector3df(8.0f, 0.0f, -35.0f),
		irr::core::vector3df(8.0f, 0.0f, 0.0f));

// Level initialization
	m_pLevelmesh = g_pIrrSmgr->getMesh("Data\\Level.3ds");
	m_pLevelnode = g_pIrrSmgr->addAnimatedMeshSceneNode(m_pLevelmesh,NULL,-1,
		irr::core::vector3df(0.0f,0.0f,0.0f));
	m_pLevelnode->setMaterialTexture(0, g_pIrrDriver->getTexture("Data\\Leveltex.bmp"));
	m_pLevelnode->setMaterialFlag(irr::video::EMF_LIGHTING, true);

	m_pLightnode = g_pIrrSmgr->addLightSceneNode(0,
		irr::core::vector3df(-15,5,-105), irr::video::SColorf(1.0f, 1.0f, 1.0f));
	g_pIrrDriver->setAmbientLight(irr::video::SColorf(0.0f,0.3f,0.3f,0.3f));
and thats the result: (ignore the black points I made them just for some test)
link
Image
my problem is Im missing some detail.
so thats how it should look like:
link
Image

could anyone tell me what Im doing wrong, please???

and excuse my bad english, please
HazardEffect
Posts: 9
Joined: Fri Feb 03, 2006 2:06 pm
Location: Wales

Post by HazardEffect »

It looks like your model is not exported with UV coordinates. What software did you use to create the model? In 3D Studio for example, you need to add a UVW mapping modifier to your model before exporting it.

There is also a problem with the Irrlicht 3ds file reader, if you make a model with no materials. When you import it some faces are lost, but I can't see if your mesh has this problem from the picture.
Lemming
Posts: 3
Joined: Fri Feb 03, 2006 8:30 pm

Post by Lemming »

I used wings3D to model and to export it to the 3ds format.
I also exportet UV-coords and I used an UV-unwrapper.

I think its a problem with the material, but I have no idea what the problem is...

I think Ill try another fileformat. wings3D is able to export some others.

so thx for reply.. maybe someone will find a mistake in the code ;)
HazardEffect
Posts: 9
Joined: Fri Feb 03, 2006 2:06 pm
Location: Wales

Post by HazardEffect »

Well I can't see anything wrong with your code, the same code works in my project. Maybe I am not clear on what your problem is exactly. I'll be happy to have a look at your mesh if you want to email me the .3ds file and texture, if that would help.
Lemming
Posts: 3
Joined: Fri Feb 03, 2006 8:30 pm

Post by Lemming »

whoooohooo I got it.
the problem was the format... now it works with the .obj format...

thats how it looks like now:
link
Image
maybe you understand what I ment. there was no depth before... only the shape you know...

thank you very much...
Post Reply