Sign in to follow this  
MARS_999

Problems with .3ds loader and polygons lighting

Recommended Posts

I have for the last week beat my head into the wall, with trying to figure out what I am doing wrong, or maybe I am not doing anything wrong... Some models do look correct from what I can see, and some models some of the polygons are not lit correctly. The polygons are dark. I am using Milkshape3D 1.8.2 if that matters... If I make a simple cube box and save that load it in the app and look at the results they look correct. I look at the TBN values and they look correct for that model. Now we are talking a simple mesh here. 20 vertices. With a more complex model like a car this is where things fall apart. Some of the polygons are dark and some look correct. I have looked over and over and can't find anything wrong with the code. Anyone have any ideas on where to start looking? Or what may be the problem. BTW I am using VC++ 2008 express and from what I can tell THERE IS NO debug build with it only release and run in debug mode.... Thanks BTW if someone has a model of a vehicle that they know works and they are willing to give away I would love to try and load it and see if it works.

Share this post


Link to post
Share on other sites
here you can find free car models, but they are in lightwave (lwo) format, if you can convert it they might be useful.

And as about the code, I can only suggest you to try to load the models with a different loader, or at least get a 3ds viewer and try to load them...
By the way, are the poligons black as they were not lit at all, or are they only darker than they should? A picture would be useful, I suppose.
What if you render the model using a flat color instead than the lighting equation? What if you put the light behind the polygons? Is the normal pointing outside the model? I don't know how you use the TBN (I only used it for normal mapping), are you using only the normal for the lighting? If not (i.e by transforming the light vector in texture space) what if you calculate everything in world space using only the normal?

[Edited by - cignox1 on January 28, 2008 3:03:54 AM]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this