I tried to load a model from 3DS file and found that it has some strange lighting effect both in osgviewer and in my application: on model's borders there're dark areas and it seems as if there're low of polygons (a screenshot and model are attached). I was suggested that the problem is with normals which are inverted to inside the model.
So, I've got 2 questions:
1. Is it right that the problem is caused by normals (as I found in 3ds plugin code, they are calculated on the fly)?
2. Can I fix them somehow after the model is loaded? For example, is there an easy way to perform something like "Recalculate Normal Outside" in Blender?
Thanks in advance for any information!
Regards,
Alexey
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=41137#41137
Attachments:
http://forum.openscenegraph.org//files/can_172.zip
_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
The 3DS format doesn't store normals, and the reader thus generates default normals PER VERTEX (and not per face), using a kind of "smooth eveything" algorithm. It fits many usages but it is clearly not adapted to your model. You may find algorithms to recompute them, but I'm not a Blender expert at all... good luck ;)
Sukender
PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/
----- "Alexey Chernov" <4er...@gmail.com> a écrit :
But can you suggest to some universal way to get valid model from 3DS in OSG? For example, is it possible to calculate normals in PER FACE mode. What's the common way to workaround problems with 3DS-imported models in OSG?
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=41236#41236
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=41265#41265
Loaded models are perfectly valid, and most users are okay with per-vertex normals. However, you seem to need a different representation. I don't have code to share witch would generate per-face normals, but this is quite straightforward. Look at the Newell method to generate normals. Or look at osgModeling, but I think it's a per-vertex basis too (however you can choose between different algorithms if I remember well).
Sukender
PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/
----- "Alexey Chernov" <4er...@gmail.com> a écrit :
> Thank you, Sukender,
So, am I right that these problems are completely because of this exact model and not the algorithm?
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=41330#41330