A couple of minor changes and it's now in the 1.6 branch-
1) I made it check whether to normalize based on the NormalizeNormals parameter of the material, which will also help for debugging purposes.
2) I had to change all your tabs to spaces, which was mildly annoying!
Thanks for the patch
[fixed] [patch] - EDS_NORMALS debug
-
- Posts: 1186
- Joined: Fri Dec 29, 2006 12:04 am
The normals of the cylinder mesh look totally wrong to me (trunk, rev. 2696):
Small test code
Small test code
Code: Select all
#include <irrlicht.h>
int main()
{
irr::IrrlichtDevice* device = irr::createDevice(irr::video::EDT_OPENGL);
irr::scene::ISceneManager* smgr = device->getSceneManager();
irr::video::IVideoDriver* driver = device->getVideoDriver();
smgr->getParameters()->setAttribute(irr::scene::DEBUG_NORMAL_LENGTH, 0.5f);
smgr->getParameters()->setAttribute(irr::scene::DEBUG_NORMAL_COLOR, irr::video::SColor(255, 255, 0, 0));
irr::scene::IMesh* const cyl = smgr->getGeometryCreator()->createCylinderMesh(0.5f, 2.0f, 8);
irr::scene::IMeshSceneNode* node = smgr->addMeshSceneNode(cyl);
node->setDebugDataVisible(irr::scene::EDS_NORMALS);
cyl->drop();
irr::scene::ICameraSceneNode* camera = smgr->addCameraSceneNode();
camera->setPosition(irr::core::vector3df(0.0f, 0.5f, -4.0f));
while (device->run())
{
driver->beginScene(true, true, irr::video::SColor(255, 255, 255, 255));
smgr->drawAll();
driver->endScene();
}
device->drop();
return 0;
}
"Whoops..."
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Yes, but that's also what the post wanted to tell us AFAIK. I guess it's a best shot for the number of vertices available, though. So we can either increase the number of vertices, or take slightly wrong lighting. I'm for both solutions, btw., because both could be useful. We need a proper geometry creator with properties for this first. So don' hold your breath for this bug being fixed...
-
- Posts: 1186
- Joined: Fri Dec 29, 2006 12:04 am