First of all, lightning on sized meshes works. Except if you scale one dimensions to zero, but I think this case doesn't make sense and it's not a bug of irrlicht, but of opengl / directx. It does not matter, so let's forget about that.
But the normals shown by DebugDataVisible confused me. Please look at the images I uploaded to the tracker. I scaled the dwarf very flat, and the normals should all point up or down now, like in my fixed version.
This is how I have changed the normal-drawing for-loop in CAnimatedMeshSceneNode::render()
Code: Select all
driver->setTransform(video::ETS_WORLD, core::matrix4());
for (u32 i=0; i != mb->getVertexCount(); ++i)
{
core::plane3df normalPlane;
normalPlane.Normal = v->Normal;
AbsoluteTransformation.transformPlane(normalPlane);
core::vector3df normalPosition = v->Pos;
AbsoluteTransformation.transformVect(normalPosition);
if (normalize)
normalPlane.Normal.normalize();
driver->draw3DLine(normalPosition, normalPosition + (normalPlane.Normal * DebugNormalLength), DebugNormalColor);
v = (const video::S3DVertex*) ( (u8*) v+vSize );
}
I used plane3df, because I couldn't find another way to transform a normal, any ideas?