import 3ds file WITH textures ?

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.
misterface
Posts: 17
Joined: Thu Aug 11, 2005 11:57 am

import 3ds file WITH textures ?

Post by misterface »

hi,

I made a 3ds max file of a level with textures from the material editor in 3ds max7. now i want to import it in irrlicht. but i dont see the textures when I run my c++ file. It seems I have to set the materials in the c++ code instead of in the max file. My question: is there a way to import a 3ds file WITH the textures?

this is the method I use now:

scene::IAnimatedMesh* mesh = smgr->getMesh(
"C:/eindwerk/code/media/hall.3ds");
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

No, Irrlicht imports them !!!

Are all needet files in the same folder ???
Are all texture file names in old DOS style ???
Have you created a light source in Irrlicht (or disabled lightning) ???
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 »

Are the textures in the same folder as your 3ds file?
they should load ok.
Just copy the jpgs or bmps from your ...\3dsmax7\maps\... folder.

If your material is not a bmp, that is if it is just diffusecolor settings, there may be something else to be done.

See what happens.
If it works do me a favor and respond to thishttp://irrlicht.sourceforge.net/phpBB2/ ... php?t=8176


EDIT: damn, Acki is quick :!:
misterface
Posts: 17
Joined: Thu Aug 11, 2005 11:57 am

Post by misterface »

doesnt work:

in the example they use the code:

scene::IAnimatedMesh* mesh = smgr->getMesh(
//"C:/eindwerk/code/media/room.3ds");
"C:/eindwerk/code/media/gang5.3ds");

smgr->getMeshManipulator()->makePlanarTextureMapping(
mesh->getMesh(0), 0.004f);

scene::ISceneNode* node = 0;

node = smgr->addAnimatedMeshSceneNode(mesh);
node->setMaterialTexture(0, driver->getTexture("C:/eindwerk/code/media/rockwall.bmp"));
node->getMaterial(0).EmissiveColor.set(0,0,0,0);


BUT I DONT WANT

node = smgr->addAnimatedMeshSceneNode(mesh);
node->setMaterialTexture(0, driver->getTexture("C:/eindwerk/code/media/rockwall.bmp"));
node->getMaterial(0).EmissiveColor.set(0,0,0,0);



my materials (jpg) dont appear from the 3dsfile created with 3ds, I can only set the material with the c++ code. without that last c++ code nothing from my scene apears :twisted:
needforhint

Post by needforhint »

Using of My3DMeshLoader with Irrlicht (it's now a part of the engine)
is more easy then ever:

1) Patching Irrlicht:

a) Replace My3D Files in Irrlicht source directory:
CMY3DMeshFileLoader.cpp
CMY3DMeshFileLoader.h
CMY3DHelper.h
CMY3DStuff.h

Files CMY3DHelper.h and CMY3DStuff.h are in ../my3d_common/ directory

b) Made some other patches (if needed) . . .

Read file ../my3d_documents/my3d_irr_patch/irr_patch.txt for more
information about that.

b) Recompile Irrlicht

2) After that you can use My3D format in your programs like this:

// seeting path to textures
scmgr->getStringParameters()->setParameter(
scene::MY3D_TEXTURE_PATH, "path/to/your/textures"
);

// loading my3d mesh
scene::IAnimatedMesh* mesh = smgr->getMesh(
"path/to/my3d_mesh/mesh.my3d"
);

Thats all!

Zhuck Dimitry (ZDimitor)

:arrow: ---Here is a link to download Zdimitor's My3DTools.3.16 : http://my3dproject.nm.ru/

you will find there also the "howtos" for proper creating the scene in 3dmax 7.0, and patching the plugin and all you need to know... :shock:
misterface
Posts: 17
Joined: Thu Aug 11, 2005 11:57 am

Post by misterface »

thank you! i'll test it this week
needforhint

Post by needforhint »

to not mess you, if you have the irrlicht 0.11.0 release, you don't have to do the patching, just use it right away:

// seeting path to textures
scmgr->getStringParameters()->setParameter(
scene::MY3D_TEXTURE_PATH, "path/to/your/textures"
);

// loading my3d mesh
scene::IAnimatedMesh* mesh = smgr->getMesh(
"path/to/my3d_mesh/mesh.my3d"
);
Guest

Post by Guest »

Zd > any hints on getting MY3D to load it's texures (and lightmaps) from a ZIP archive? Can load anything else with irrlichts virtual file system (from a zip) but my3d refuses to look in the zip.

any clues? any fixes possible?

thanks
misterface
Posts: 17
Joined: Thu Aug 11, 2005 11:57 am

Post by misterface »

my3dmaxexporter question:

1) compile plugin into *.dle library file

2) copy it in MAX/plugins directory


???? how do i compile the plugin? what do I have to copy?
bitmapbrother
Posts: 34
Joined: Wed Aug 10, 2005 6:15 am

Post by bitmapbrother »

U dont need to compile it. Its bundled with irrlicht in directory "exporters\3dsmax.my3d\my3d_max7_exporter.dle". Just copy it to "3dsmax7\plugins" and restart 3dsmax. Works fine for me but I didnt tried animated mesh yet.
misterface
Posts: 17
Joined: Thu Aug 11, 2005 11:57 am

Post by misterface »

thanks!

next problem :s

1 - Draw scene (3d objects, lights, materials e.t.c)
2 - Bring up the Render-To-Texture Dialog. ('Rendering'->'Render To Texture' option)
3 - Mark a mesh you want to bake.
4 - In Output Rollout, click on the 'Add...' button in the RTT dialog
and chose LightingMap
5 - Assign 'Target Map Slot:' to Diffuse (only in MAX6,7)

step 5 doesnt work, i can't select anything
bitmapbrother
Posts: 34
Joined: Wed Aug 10, 2005 6:15 am

Post by bitmapbrother »

Uhh ... I am not doing it like that. I just select all with CTRL+A and then export it with "File->Export" <My3d Scene Exporter>. Maybe someone more advanced will advice u.
misterface
Posts: 17
Joined: Thu Aug 11, 2005 11:57 am

Post by misterface »

thanks found it!
you are more advanced than me so thats good :p
misterface
Posts: 17
Joined: Thu Aug 11, 2005 11:57 am

Post by misterface »

last problem (i hope):

// seeting path to textures
scmgr->getStringParameters()->setParameter(
scene::MY3D_TEXTURE_PATH, "path/to/your/textures"
);

// loading my3d mesh
scene::IAnimatedMesh* mesh = smgr->getMesh(
"path/to/my3d_mesh/mesh.my3d"
);



how do i define a scmgr?? ????* scmgr = ???
bitmapbrother
Posts: 34
Joined: Wed Aug 10, 2005 6:15 am

Post by bitmapbrother »

Code: Select all

ISceneManager* smgr = device->getSceneManager();
Post Reply