Title: Global light vector relation Post by: lxh on April 02, 2013, 03:29:12 PM Hi Jesse,
sorry that i bother you again with my spinnings but maybe this is not a big deal for you. It can be hard to find the right light angle again if you want to fix the light to the object. On the other side if it's fixed and fits the background image perfectly it would be great to take it back again to the cam for a perspective correction. Is it possible to recalculate the global light vector while changing between camera and object relation? Title: Re: Global light vector relation Post by: Jesse on April 03, 2013, 01:36:55 AM Hi lxh,
this should be a useful feature, adjust the sliders automatically when changing the 'light relative to object' option... put it on the todo-list. Title: Re: Global light vector relation Post by: lxh on April 09, 2013, 07:14:45 PM Thanks for the implementation, Jesse! It is as you say, a useful feature. You saved me from fumbling around over and over and over again. Tank you! :)
Title: Re: Global light vector relation Post by: Jesse on April 09, 2013, 09:57:42 PM I found that it will not work on all light angles, did a newton-like approach to find the angles... must be some deadlocks somewhere or so.
Title: Re: Global light vector relation Post by: lxh on April 10, 2013, 10:29:37 AM Hmmm, didn't notice that yet. If it helps in most situations it is still better than every time struggling with the obj. rel. angles. But deadlocks? Hm, i'm not the right person to assess the problem and might stultify myself but maybe it's a simple radians thing which can be solved by modulo 2PI?
Title: Re: Global light vector relation Post by: hobold on April 10, 2013, 11:34:40 PM Euler angles suffer from a phenomenon called "gimbal lock" (that's why people are fond of using quaternions instead). I am unsure if that is the problem here, but maybe a few more buzzwords can give Jesse hints to a solution.
Title: Re: Global light vector relation Post by: cKleinhuis on April 10, 2013, 11:53:20 PM just a side note: this gimbal lock is assumed to be the reason for the whipped cream in the mandelbulb as well ;)
the gimbal lock can be thought of the problem of at least 2 possibilities to express a point location in 3d through 3 rotation angles, leaving aside 1 axis, does not imply perfect description of the point, since it still can be expressed through 2 ( or more ) variants, for example (-1,0,0) could be expressed as either 180,0 (assuming Z/Y axises) angles, or as (0,180) (assuming Z/Y axises as well ) the quaternions counter this, somehow, but i do not fully understood it what they do change, but it can be thought of as the tangent vector that is kept to a point that preserves the orientation .... just my 1cent side note.... Title: Re: Global light vector relation Post by: Jesse on April 10, 2013, 11:59:30 PM Euler angles suffer from a phenomenon called "gimbal lock" (that's why people are fond of using quaternions instead). I am unsure if that is the problem here, but maybe a few more buzzwords can give Jesse hints to a solution. Yes, "gimbal lock" was what i meant, but i guess i already found the issue in my code, nothing worth to talk about :dink: |