hi,

i'm trying to understand how to use pfunc's and bumped into a crash with this script:

(clear)

(define pf (make-pfunc 'arithmetic))

(pfunc-set! pf (list 'operator "x"
                    'src "p"
                    'dst "p"
                    'constant .5))

(with-primitive (build-cube)
    (pfunc-run pf))

if the operator does not exist fluxus crashes.

--

i would expect that the following pfunc scales the primitive by 5.
(pfunc-set! pf (list 'operator "mul"
                    'src "p"
                    'dst "p"
                    'constant 5))

although it does not do anything. it works if i change the constant from "5" to "5."

--

if i understand it right, the constant cannot be a vector, only a float. although it seems that this pfunc adds (vector 1. 1. 1.) to "p".

(pfunc-set! pf (list 'operator "add"
                    'src "p"
                    'dst "p"
                    'constant 1.))

--

i would like to add a new arithmetic operator "lerp" that linearly interpolates between two pdata. i didn't see any arithmetic pfuncs that operates on 'src, 'other, 'constant and 'dst at the same time, but this would be needed for the interpolation. is this possible? or should i be thinking about a new pfunc type instead?

best,
gabor

Reply via email to