|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Warp wrote:
> Jaime Vives Piqueres <jai### [at] ignoranciaorg> wrote:
>> // sloped texture with autoilluminated finish
>> #declare t_terrain_slope=
>> texture{
>> pigment{
>> slope y
>
> That shows the slope of the heightfield, not the *change* in slope,
> which is a bit more involved (it would require the derivative of the
> function which indicates the slope of the heightfield; since the slope
> function is the derivative of the heightfield function, the change in
> slope would thus be the double derivative of the heightfield function).
>
> Maybe the original poster really wanted to actually see the slope,
> rather than the change in slope, in which case your answer would be
> the correct one.
>
Is there a function in POV that will allow me to automatically take the
derivative of another function?
-Mike
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
SharkD <mik### [at] gmailcom> wrote:
> Nope. I want the double derivative.
Then your only option is to generate the heightfield using a function
and then use the double derivative of that function with respect to x and
another with respect to y and combine them appropriately to create the
desired pattern, which you then can use to create the pigment.
--
- Warp
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
SharkD <mik### [at] gmailcom> wrote:
> Is there a function in POV that will allow me to automatically take the
> derivative of another function?
Calculating the derivative of a function analytically is not trivial
and has such low demand that povray obviously doesn't offer such a thing.
A numerical approximation could be easier, but still the demand is so
low that no such luck.
But I think the user-defined functions are expressive enough for you to
do it in SDL.
--
- Warp
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Warp wrote:
> SharkD <mik### [at] gmailcom> wrote:
>> Is there a function in POV that will allow me to automatically take the
>> derivative of another function?
>
> Calculating the derivative of a function analytically is not trivial
> and has such low demand that povray obviously doesn't offer such a thing.
>
> A numerical approximation could be easier, but still the demand is so
> low that no such luck.
>
> But I think the user-defined functions are expressive enough for you to
> do it in SDL.
>
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Warp wrote:
> But I think the user-defined functions are expressive enough for you to
> do it in SDL.
>
OK, so how would I go about doing it?
-Mike
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
clipka wrote:
> SharkD schrieb:
>> How can I create a pattern that shows the *change* in slope of a
>> heightfield. I.e., brighter where the "curvature" is greater.
>
> You can create this from the image you use for the height field
>
> To begin with, make a pigment from the image; make from that a function F.
>
> Now, create a function G computing the curvature from five function
> values from F, spaced apart by (at least) 1/BITMAP_SIZE, to compute the
> "difference in difference" both vertically and horizontally:
OK, here's what I have:
//START
#local hf_function1 = function {pigment {hf_pigment3}}
#local dv_D = 1/1024;
#local dv_Sqr = function(x) {x * x}
#local dv_G = function(x,y,z)
{
sqrt
(
dv_Sqr(hf_function1(x - dv_D,y,z) + hf_function1(x + dv_D,y,z) - 2 *
hf_function1(x,y,z))
dv_Sqr(hf_function1(x,y - dv_D,z) + hf_function1(x,y - dv_D,z) - 2 *
hf_function1(x,y,z))
)
}
//END
However, I get the error: "Parse Error: Expected '.', + found instead"
-Mike
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
SharkD <mik### [at] gmailcom> wrote:
> Warp wrote:
> > But I think the user-defined functions are expressive enough for you to
> > do it in SDL.
> >
> OK, so how would I go about doing it?
http://en.wikipedia.org/wiki/Derivative
--
- Warp
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
clipka wrote:
> sqrt(
> Sqr( F(x-D,y,z) + F(x+D,y,z) - 2*F(x,y,z) ) // squared curvature X
> Sqr( F(x,y-D,z) + F(x,y-D,z) - 2*F(x,y,z) ) // squared curvature Y
> )
Also, there's supposed to be an operator between the first and second
instances of the function "Sqr". Which operator is it?
-Mike
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Warp wrote:
>> OK, so how would I go about doing it?
>
> http://en.wikipedia.org/wiki/Derivative
>
Please point me to the part where it describes POV SDL.
Thanks.
-Mike
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
SharkD schrieb:
> clipka wrote:
>> sqrt(
>> Sqr( F(x-D,y,z) + F(x+D,y,z) - 2*F(x,y,z) ) // squared curvature X
>> Sqr( F(x,y-D,z) + F(x,y-D,z) - 2*F(x,y,z) ) // squared curvature Y
>> )
>
> Also, there's supposed to be an operator between the first and second
> instances of the function "Sqr". Which operator is it?
Oops, sorry - should be "+".
The idea behind it is that each terms inside the Sqr() computes the
curvature in a particular dimension; if you interpret that as a vector,
the sqrt(Sqr()+Sqr()) computes the "absolute" of the curvature.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |