problem with makePlanarTextureMapping

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
ppalmeira
Posts: 2
Joined: Tue Aug 18, 2015 8:21 pm

problem with makePlanarTextureMapping

Post by ppalmeira »

this topic was posted int be the beginner help, with no answer
Hi guys

I've got a problem with ->makePlanarTextureMapping funtion
it apparently conflists whith ->setScale

Firstly I tried using the >addCubeSceneNode, look:

float x=GETnum((kerncell)SM_(add_box),argx),
y=GETnum((kerncell)SM_(add_box),argy),
z=GETnum((kerncell)SM_(add_box),argz),
r=GETnum((kerncell)SM_(add_box),ARGnum4);
ITexture* TXTU=(ITexture*) getextern(SM_(add_box),ArgNumI(5),ITexturesym);

scene::IAnimatedMesh* mesh;
scene::IMeshSceneNode * node =smgr->addCubeSceneNode();

if( node)
{
node ->setScale(core::vector3df(x,y,x));
node->setMaterialTexture(0,TXTU );

mesh = node->getMesh();
smgr->getMeshManipulator()->makePlanarTextureMapping(mesh,r);*/
node ->setMesh(mesh);


node->setMaterialTexture(0,TXTU );
node->setMaterialFlag(video::EMF_LIGHTING, false);


}
This one works but the >makePlanarTextureMapping doesn´t work with >makePlanarTextureMapping. Everything is gray


The second code I tried using an external mesh loading, look the code:

kerncell argx=ARGnum1,
argy=ARGnum2,argz=ARGnum3;
CHECKlargs((kerncell)SM_(add_box),5);
float x=GETnum((kerncell)SM_(add_box),argx),
y=GETnum((kerncell)SM_(add_box),argy),
z=GETnum((kerncell)SM_(add_box),argz),
r=GETnum((kerncell)SM_(add_box),ARGnum4);
ITexture* TXTU=(ITexture*) getextern(SM_(add_box),ArgNumI(5),ITexturesym);

scene::IAnimatedMesh* mesh;
mesh = smgr->getMesh("base.3ds"); // I try a various meshs

scene::IMeshSceneNode * node;

if (mesh)
{
smgr->getMeshManipulator()->makePlanarTextureMapping(mesh->getMesh(0), r); // here is makePlanarTextureMapping
node = (IMeshSceneNode*)smgr->addAnimatedMeshSceneNode(mesh);
node ->setScale(core::vector3df(x,y,x)); // use this the model turn to gray
node->setMaterialTexture(0,TXTU );
node->setMaterialFlag(video::EMF_LIGHTING, false);
}

In this case:
when use ...
node ->setScale(core::vector3df(x,y,x));

This works fine but wihtout all is gray


anyboby helpme !!!!!!!!!!!!!!!!!!
Post Reply