opengl-test   scheme


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

Implementation

;;
;; opengl-test includes two sources
;; of constant wind speed
;;
;; bottom->top: straight up the middle
;; left->right: oscillates from back to front
;;
;; You might need to slow the rate of this
;; temporal recursion down if your machine
;; doesn't cope.  (i.e. 3000 to 5000 or more
;;
;; standard impromptu callback
(define opengl-test
  (lambda (time degree)
    (my-gl-loop)
    ;; 1000.0 is wind speed from bottom to top
    (add-velocity 11 1 11 0.0 1000.0 0.0)
    ;; 600.0 is wind speed from left to right
    (add-velocity 2 5 11 300.0 0.0 (+ 200.0 (* 200.0 (cos (* 100.0 degree)))))
    ;; everynow and then remove smoke from cube
    (if (< (modulo degree 1.0) 0.005) (clean-cube))
    (gl:swap-buffers pr2)
    (callback time 'opengl-test (+ time 3000) (+ degree 0.001))))


Back to Index

Similar Entries