• Advertisement
Sign in to follow this  

problem rendering (properly lighting) model with WPF

This topic is 816 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.






Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement