no 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
thespongebob
Posts: 12
Joined: Fri Feb 17, 2006 11:53 pm

no textures

Post by thespongebob »

Hi,

I can see the debug outline but I can't see the textures on the box. The physics work fine. What am I missing?

Randy


-------------------------------------------------->

struct NewtonCube {
IAnimatedMesh *mesh;
ISceneNode *node;
NewtonBody *body;
NewtonCollision *collision;


NewtonCube *tmp = new NewtonCube;
tmp->mesh = smgr->getMesh("data/smallcube.3ds");
tmp->node = smgr->addAnimatedMeshSceneNode(tmp->mesh);
tmp->node->setMaterialTexture(0, driver->getTexture("data/crate.jpg"));
tmp->collision = NewtonCreateBox(nWorld, 10, 10, 10, NULL);
tmp->body = NewtonCreateBody(nWorld, tmp->collision);
NewtonBodySetUserData(tmp->body, tmp->node);
NewtonBodySetMassMatrix (tmp->body, 10.0f, 150.0f, 150.0f, 150.0f);
NewtonBodySetFreezeTreshold(tmp->body, 1.0, 1.0, 1.0);
NewtonBodySetTransformCallback(tmp->body, PhysicsSetTransform);
NewtonBodySetForceAndTorqueCallback(tmp->body, PhysicsApplyForceAndTorque);
NewtonBodySetMatrix(tmp->body, &dump_location[0][0]);
Randy

MS .NET 2.0
MS C# 8
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

You're the one with all of the source code and the debugger, why can't you tell us? Have you even stepped into any of the code? I'd guess that the call to getTexture was failing, but I've been wrong before.
thespongebob
Posts: 12
Joined: Fri Feb 17, 2006 11:53 pm

no textures

Post by thespongebob »

ahaha

sorry I asked but I am working from demos because I don't know as much as you do ...
Randy

MS .NET 2.0
MS C# 8
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

Is your 3ds file properly textured-uvmapped?

If so, then you don't even need to set the line for its texture:

Code: Select all

tmp->node->setMaterialTexture(0, driver->getTexture("data/crate.jpg")); 
just placing the jpg at the same level of your 3ds will do. Texture loads automatically.
thespongebob
Posts: 12
Joined: Fri Feb 17, 2006 11:53 pm

Post by thespongebob »

Thanx for the advice A.

As it turned out, I had my NewtonBodySetTransformCallback handler screwed up. No error ... it just displayed black w/ Newton wireframe.
Randy

MS .NET 2.0
MS C# 8
Post Reply