I've made a model of a chess piece and exported to OBJ. I'm trying to load and render it in c# WPF and having some trouble with shading/lighting.
I have a white directional light and white ambient light. The chess piece is rendered with a black material.
The problem I am trying to solve is the lighting/shading. It does not seem to be working. Any suggestions? All I see is opaque black. However, when I open the same model in Open3dMod it looks perfect so I don't think the vertex normals are wrong.
Screen shot from my running code (shading wrong)...
Screen shot from open3dmod viewer (shaded correcty)...
I have attached my rendering code (code-behind and xml). I have also attached the model (obj format). Any suggestions to get the lighting and shading working in my code would be appreciated. I don't know what I am doing wrong here.