开发者

Half normals are wrong

开发者 https://www.devze.com 2023-03-21 08:08 出处:网络
I\'m using a program called sculptris to create models in Wavefront OBJ format. I just created my first couple models and am now trying to import them into an OpenGL scene. I\'ve never written an obje

I'm using a program called sculptris to create models in Wavefront OBJ format. I just created my first couple models and am now trying to import them into an OpenGL scene. I've never written an object loader before tonight but I'm pretty sure I got the parsing of the OBJ file right. Unfortunately, when I add lighting, it seems that the normals on half of the model开发者_如何学JAVA are incorrect. Without lighting, the model is textured and colored correctly and looks perfect. With lighting the image looks like this...

Half normals are wrong

If half the model is correct, I'm pretty sure there is nothing wrong with my OBJ parsing. Therefore sculptris must only have the normals correct for half the model (probably something resulting from the symmetry of the sculpting). If anyone's familiar with the program, know what I'm doing wrong. For those that are just familiar with OBJ in general, is there something I don't know about OBJ involving duplicate normals (which there are because the model is left-right symmetrical)?


This model is symmetrical. So there's a fairly good chance that you created it by creating half of it and then mirroring it. In many modelling applications, mirroring inverts the normal and changes the winding order. So you will have to select those faces and flip their normals.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号