• Create Account

### #ActualHodgman

Posted 31 August 2012 - 12:29 AM

Our problem is we have no way of reversing that logarithmic depth at this point..

You probably should have named your thread "reconstructing position from logarithmic depth" then

WolframAlpha can be useful for tasks like this.
e.g. assuming you're using the formula: depth = log(c*originalZ + 1) / log(c*far + 1)
You can copy that into wolfram, and ask it to solve for z: http://www.wolframal...) ; solve for z
And it spits out originalZ = (pow(c*far+1,depth)-1)/c

I make no guarantees about the validity of this formula -- just giving you another tool to try ;)

### #2Hodgman

Posted 31 August 2012 - 12:29 AM

Our problem is we have no way of reversing that logarithmic depth at this point..

You probably should have named your thread "reconstructing position from logarithmic depth" then

WolframAlpha can be useful for tasks like this.
e.g. assuming you're using the formula: depth = log(c*originalZ + 1) / log(c*far + 1)
You can copy that into wolfram, and ask it to solve for z: http://www.wolframal...) ; solve for z
And it spits out originalZ = (pow(c*far+1,depth)-1)/c

I make no guarantees about the validity of this formula -- just giving you another tool to try ;)

### #1Hodgman

Posted 31 August 2012 - 12:28 AM

Our problem is we have no way of reversing that logarithmic depth at this point..

You probably should have named your thread "reconstructing position from logarithmic depth" then

WolframAlpha can be useful for tasks like this.
e.g. assuming you're using the formula: depth = log(c*originalZ + 1) / log(c*far + 1)
You can copy that into wolfram, and ask it to solve for z: http://www.wolframalpha.com/input/?i=d+%3D+log2%28c*z+%2B+1%29+%2F+log2%28c*f+%2B+1%29+%3B+solve+for+z
And it spits out originalZ = (pow(c*far+1,depth)-1)/c

I make no guarantees about the validity of this formula -- just giving you another tool to try ;)

PARTNERS