Hi !
my lighting works when i load my model but if i rotate the model the nex part in front of the light isn't lighted !
Do you know why ? what can i do ?

ce110ut

04-26-2005, 09:38 AM

hard to tell - could you post a code snippet?
:regards:

UrbanLegend

04-26-2005, 11:50 AM

What type of light

Does all you model have correct normals etc..

Are you rotating your light as well

Basically more information is needed

airseb

04-26-2005, 11:58 AM

in fact it works with some files(i am making a .3ds loader)and my model have at least some good normals (i have checked it), do you think it's possible that some others aren't right. I don't try to rotate the light, just the model.

ce110ut

04-26-2005, 12:51 PM

I apologize but I do not see where you have lighting involved. as far as the normals go, as long as they are "normalized" appropriately in your myLoader->myObjects[i].perVertexNormals data object. also, what if you have a model that encompasses the light source? could that be possible?

:regards:

airseb

04-26-2005, 01:09 PM

sorry i didn't pay attention :
this is normals computation (the function "multiplyMatrix" multiply normals by the rotation part of the tranformation matrix of the .3ds in which i read)
void loader3ds::loadIndices()
{
float resultDp ;
ofstream oFile2("sortie3ds2.txt");