3ds file 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.
Post Reply
Robomaniac
Posts: 602
Joined: Sat Aug 23, 2003 2:03 am
Location: Pottstown, PA
Contact:

3ds file Textures

Post by Robomaniac »

I have made a simple model using anim8or and then exported it to 3ds and when i load it in the engine, the model is all black. The only textures i'm using are the materials in anim8or. I currently do not have a texture file.

The Robomaniac
DarkWhoppy
Posts: 386
Joined: Thu Sep 25, 2003 12:43 pm
Contact:

Post by DarkWhoppy »

Node->setMaterialFlag(EMF_LIGHTING, false);

Use that to light up the model... "Node" is the models Node. But I think you'll have to have a texture file. And attach it to the model with...

Node->setMaterialTexture(0, driver->getTexture("TEXTURENAME.jpg"));
Robomaniac
Posts: 602
Joined: Sat Aug 23, 2003 2:03 am
Location: Pottstown, PA
Contact:

Post by Robomaniac »

EDIT : I forgot to use the video:: prefix thanks. :shock: :roll:
but now the model is all white with no texture.

I tried to use the setMaterialFlag line, and it gave me a error saying EMF_LIGHTING undeclared (first use this function)

Also, how would i make and view a texture for this model
DarkWhoppy
Posts: 386
Joined: Thu Sep 25, 2003 12:43 pm
Contact:

Post by DarkWhoppy »

Thats odd.... are you using Dev-C++?? (I am 8) )

Tell me if this fixes your prob...
Make sure the Irrlicht.DLL is in the SAME folder as your EXE.
This should be all you have at the top of your CPP file (or Header):

Code: Select all

#include <irrlicht.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
#pragma comment(lib, "Irrlicht.lib")
[dx/x]=HUNT3R
Posts: 271
Joined: Sat Aug 23, 2003 5:52 pm
Location: Hurricane Central, Florida

Post by [dx/x]=HUNT3R »

Robomaniac wrote:Also, how would i make and view a texture for this model
I use Milkshape, but in Milkshape you group faces of your model and then load in a jpeg or some picture file for textures (I use Paint Shop Pro 7 to make mine and save them as jpegs). Those are materials, then you just have to apply each group to whatever section of the jpeg that has the texture you want for that group. Then you just save the model and, like DarkWhoppy said, in your code you do a

Code: Select all

Node->setMaterialTexture(0, driver->getTexture("TEXTURENAME.jpg"));
My point is.. you need a texture file to load in and apply to your model.
DarkWhoppy
Posts: 386
Joined: Thu Sep 25, 2003 12:43 pm
Contact:

Post by DarkWhoppy »

I'm getting that same error now.... everything was fine but I reorganized my code into a class and now.. `EMF_LIGHTING' undeclared
[dx/x]=HUNT3R
Posts: 271
Joined: Sat Aug 23, 2003 5:52 pm
Location: Hurricane Central, Florida

Post by [dx/x]=HUNT3R »

You are using the video namespace right? And the irr namespace too right?
DarkWhoppy
Posts: 386
Joined: Thu Sep 25, 2003 12:43 pm
Contact:

Post by DarkWhoppy »

Yep...
t

Post by t »

You need to declare the EMF_LIGHTING flag's namespace.

setMaterialFlag(video::EMF_LIGHTING, false);
DarkWhoppy
Posts: 386
Joined: Thu Sep 25, 2003 12:43 pm
Contact:

Post by DarkWhoppy »

Yea, found that out last night... now off to school :roll:
Post Reply