model's normals are problem

Started by
9 comments, last by Scavenger23 18 years, 7 months ago
Image I imported a .obj into Irrlicht and created a light, and this is what I got. This is the creation code:

   scene::IAnimatedMesh* mesh = smgr->getMesh("fighter_outside.obj"); 
   scene::ISceneNode* node = 0; 
   scene::ILightSceneNode* light = 0; 
    
   if (mesh) 
   { 
      node = smgr->addOctTreeSceneNode(mesh->getMesh(0)); 
      node = smgr->addLightSceneNode(); 
   } 


   if (node) 
   { 
      node->setPosition(core::vector3df(-1,-5,5)); 
   } 

   if (light) 
   { 
      node->setPosition(core::vector3df(50,5,-7)); 
   } 
Does anyone have suggestions on how to fix this? [Edited by - Scavenger23 on August 19, 2005 4:54:18 PM]
----------------------------Project Legend
Advertisement
You could replace "node" with "light" at the appropriate positions, this might work wonders.

~matt();
You mean like this?
   scene::IAnimatedMesh* mesh = smgr->getMesh("fighter_outside.obj");    scene::ISceneNode* node = 0;    scene::ILightSceneNode* light = 0;        if (mesh)    {       node = smgr->addOctTreeSceneNode(mesh->getMesh(0));       light = smgr->addLightSceneNode();    }    if (node)    {       node->setPosition(core::vector3df(-1,-5,5));    }    if (light)    {       light->setPosition(core::vector3df(50,5,-7));    } 


That doesn't work either. The model acts like the normals are inverted, but when I flip the normals on the model it is still the same. The light actually lights up the right parts, though.
----------------------------Project Legend
How about you replace that last light function with node
Belive it or not...this is C++....
I did, it still doesn't work. :(
----------------------------Project Legend
uh...change mesh to node. That might work
Belive it or not...this is C++....
well, I fixed almost all of it, but it stil looks inverted. The shading is right, buy it always looks as if the normals are facing inward, no matter what I do to the model.
----------------------------Project Legend
Try and re map your textures
Belive it or not...this is C++....
There aren't any textures, or a UV map. Just vertices, edges, and faces.
----------------------------Project Legend
ahh. Sorry man, but I havnt really used irrlicht.
Belive it or not...this is C++....

This topic is closed to new replies.

Advertisement