|
|
Christoph Hormann wrote:
> David Burnett wrote:
>
>> Here's some test images from a quick patch I've created.
>>
>> I've let warp take a function so
>>
>> warp {
>> function{f_bozo(x,y,z)}
>> }
>>
>> is now legal, working syntax.
>
>
> Such a feature was already planned for MegaPOV but not yet implemented.
> I don't really understand how you define a warp with a single float
> function though. The planned feature was supposed to use a vector
> function.
>
> Christoph
>
It's just a straight forward multiplication
of each part of the original point by the results
of the function, so for the example images its
equivalent to...
f_crackle(x*f_bozo(x,y,z), y*f_bozo(x,y,z), z*f_bozo(x,y,z))
if f_crackle used form <1,0,0>, with the advantage of only
having to work out the function result once (and nicer syntax :0)).
In code term, the important bit is
POVFPU_SetLocal(X, EPoint[X]);
POVFPU_SetLocal(Y, EPoint[Y]);
POVFPU_SetLocal(Z, EPoint[Z]);
value = POVFPU_Run(*((FUNCTION_PTR)(Warp->Function.Fn)));
EPoint[X] *= value;
EPoint[Y] *= value;
EPoint[Z] *= value;
Any one is welcome to the code, I just want to tidy it up first
in proper pov patch style.
Dave.
Post a reply to this message
|
|