My 3DS Model is White

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
MrBigBrain

My 3DS Model is White

Post by MrBigBrain »

Hello, when I load a 3D Model with .3ds format and display it on the scree, the model is totally White.
Heres my Code:

Code: Select all

scene::IAnimatedMeshSceneNode *weapon = smgr->addAnimatedMeshSceneNode( smgr->getMesh("C:/Dokumente und Einstellungen/Admin/Desktop/irrlicht/irrlicht-0.14.0/media/famas.3ds"));
	weapon->setParent(camera);
	weapon->setPosition(core::vector3df(72,-100,110));
	

	weapon->setMaterialFlag(video::EMF_LIGHTING,false));
The other code is exactly theone from the Terrain Tutorial.

Sorry for my bad English I`m from Germany.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

Be sure all needed textures are in the same folder as the 3ds file !!!
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
killzone721
Posts: 19
Joined: Thu Feb 09, 2006 1:45 am

Post by killzone721 »

doesn't necessary have to be in the 3ds, but it has to be a graphic file representing the 3ds model.

Just make sure to have a graphic file with and if it does, i don't see u calling it

ex.

weapon1->setMaterialTexture(0, driver->getTexture ("models/moreweapons/lazer.jpg"));


//this is just an example but use the code for your grahics/texture file

HOPE IT HELPS :wink:
TO ALL THE AMATEURS OUT THERE LIKE ME......

AIM HIGH AND YOU MAKE SOMETHING PRETTY DECENT TO SHOW THE WORLD

CURRENTLY WORKING ON MY COMPANY WITH ME CREW MEMBERS. MY COMPANY IS CALLED
BIG DREAMS
AND WE ARE MAKE VERSION 0.1 FPS GAME
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

Right, you can also do it this way...

But if the graphics are all inside the same folder as the 3ds file they will be loaded automatically... ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
luckymutt
Posts: 453
Joined: Sun Mar 06, 2005 11:56 pm
Location: C-Ville

Post by luckymutt »

Also, it is a good idea to use a relative path instead of an absolute path.
Instead of doing:

Code: Select all

getMesh("C:/Dokumente und Einstellungen/Admin/Desktop/irrlicht/irrlicht-0.14.0/media/famas.3ds"));
do something like:

Code: Select all

getMesh("../media/famas.3ds"));
so your *.exe looks for the files relative to where it is.
Join us in the Irrlicht chatroom:
[url]irc://irc.freenode.net/irrlicht[/url]

I love deadlines. I like the whooshing sound they make as they fly by. -D.Adams
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

Well, I forgot that getTexture only works with one texture file...
If your mesh uses more than one texture file you can't use getTexture !!!
Well, you can but it messes up the texture on the mesh... ;)

So, the best way is to be sure all files are in the same folder !!!
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Post Reply