Jump to content
  • Advertisement
Sign in to follow this  
timothyjlaird

problem rendering (properly lighting) model with WPF

This topic is 913 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)...

 

wpf_king_ss_zps0yvdesa6.jpg

 

Screen shot from open3dmod viewer (shaded correcty)...

 

wpf_king_ss_viewer_zpsk0nfn6mt.jpg

 

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.

 

Thanks,

John

 

 

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!