PDA

View Full Version : Math Problem at shadow volumes



unreal
12-02-2004, 11:39 PM
hehe... As you all know here is an other problem at my shadow volume project...i think its a math problem..
I have an freezed object. And I have a light. THen the shadow is correct. now if I try to move the object(using a rotate,translate) the shadow remains at the same place. this is correct because the actuam vertex position of the silhuette does not change. now before I draw the shadow volume I do this: glMultMatrixf(primitive->prMatrix); Now the shadow moves while the object moves but not correct.

I try to just multiply the light position with the objects matrix and then pass the resulting light position in the draw shadow volume function but the result is not correct.

anyidea what is wrong?
thanks in advance

unreal
12-03-2004, 12:11 AM
nah.. forget it... found it... just forgot to multiply the light position with the objects matrix(inverse) when calculating silhuette.. :)

unreal
12-03-2004, 02:56 AM
well... not fixed it 100%. I have a little problem... the shadows behaves like the object is always at (0,0,0) of the world. If I place the object at worlds(0,0,0) the shadow is perfect. if dont place it at (0,0,0) then the shadow behaves like it is at (0,0,0). Strange... Maybe have some mistake somewere else.

what I do until now is:
get the inverse matrix of the object and multiply it with the lights position. then I pass the new light coords in the Calculate silhuette edges function.
after this I draw the shadow volumes using the new light coords.
is this way correct? or I miss something?

C++
12-11-2004, 02:58 AM
You must rebuild shadow volume when you moving lights or objects

C++
12-12-2004, 08:32 AM
Interesting, what foreigners think about Russia?

C++
12-13-2004, 07:23 AM
24 hours left and nothing bad posted, it`s good...
or YOU have something very bad to say?

C++
12-14-2004, 09:27 AM
I live in Russia - are you hate me and my country now? Tell me the truth.
Waiting...

yjh1982
12-14-2004, 04:05 PM
Originally posted by C++:
I live in Russia - are you hate me and my country now? Tell me the truth.
Waiting...I can't believe.
I don't think this Forums related about country
or politics........

rgpc
12-14-2004, 04:14 PM
Originally posted by C++:
I live in Russia - are you hate me and my country now? Tell me the truth.
Waiting...Did you ever think that maybe unreal hasn't been online for a while?

STFU and stop looking for gratification.

unreal
12-14-2004, 09:25 PM
ooh my god! What are you saying man? I just haven't been on line for a while. I dont hate you or your country man. I had a lot of works to do and i didnt had the time to check the forum.
peace! :)
I finaly fix the problem. i was moving the light into object space wrong. now I fix it and i works.
thanks anyway.

C++
12-15-2004, 09:55 AM
Glad that you fixed your problem.
PS
I can't believe, they perceived my posts seriously...