add-density-xy   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/examples/contrib/kinect_fire.xtm

Implementation

(bind-func add-density-xy
 (lambda (x y amt:double)
   (let ((xs (* (* 320.0 0.5) scale-x))
   (xy (* (* 360.0 0.5) scale-y))
   (xx (dtoi64 (range-limit (+ offset-x xs (* xs x)) 0.0 320.0)))
   (yy (dtoi64 (range-limit (+ offset-y xy (* xy y)) 0.0 180.0))))
     (set! amt (* amt 1.0))
     (if (< yy 180)
   (add-density-1 xx yy amt)
   (add-density-2 xx (- yy 180) amt)))
   void))


Back to Index