Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Math Problem at shadow volumes

  1. #1
    Intern Contributor
    Join Date
    Jun 2004
    Location
    Greece
    Posts
    83

    Math Problem at shadow volumes

    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

  2. #2
    Intern Contributor
    Join Date
    Jun 2004
    Location
    Greece
    Posts
    83

    Re: Math Problem at shadow volumes

    nah.. forget it... found it... just forgot to multiply the light position with the objects matrix(inverse) when calculating silhuette..

  3. #3
    Intern Contributor
    Join Date
    Jun 2004
    Location
    Greece
    Posts
    83

    Re: Math Problem at shadow volumes

    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?

  4. #4
    Intern Contributor
    Join Date
    Nov 2002
    Location
    St.Peterburg, Russia
    Posts
    66

    Re: Math Problem at shadow volumes

    You must rebuild shadow volume when you moving lights or objects

  5. #5
    Intern Contributor
    Join Date
    Nov 2002
    Location
    St.Peterburg, Russia
    Posts
    66

    Re: Math Problem at shadow volumes

    Interesting, what foreigners think about Russia?

  6. #6
    Intern Contributor
    Join Date
    Nov 2002
    Location
    St.Peterburg, Russia
    Posts
    66

    Re: Math Problem at shadow volumes

    24 hours left and nothing bad posted, it`s good...
    or YOU have something very bad to say?

  7. #7
    Intern Contributor
    Join Date
    Nov 2002
    Location
    St.Peterburg, Russia
    Posts
    66

    Re: Math Problem at shadow volumes

    I live in Russia - are you hate me and my country now? Tell me the truth.
    Waiting...

  8. #8
    Intern Newbie
    Join Date
    Dec 2003
    Location
    china
    Posts
    37

    Re: Math Problem at shadow volumes

    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........

  9. #9
    Advanced Member Frequent Contributor
    Join Date
    Apr 2000
    Location
    Melbourne,Victoria,Australia
    Posts
    767

    Re: Math Problem at shadow volumes

    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.

  10. #10
    Intern Contributor
    Join Date
    Jun 2004
    Location
    Greece
    Posts
    83

    Re: Math Problem at shadow volumes

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •