distribute_particles   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/examples/external/shader-tutorials/particles.xtm

Implementation

(bind-func distribute_particles
  "randomly initialise the particles_verts to "
  (lambda (np)
    (doloop (i np)
      (pset! particles_verts (+ (* i 4) 0) (random -1. 1.))
      (pset! particles_verts (+ (* i 4) 1) (random -1. 1.))
      (pset! particles_verts (+ (* i 4) 2) (random -1. 1.))
      (pset! particles_verts (+ (* i 4) 3) (random -1. 1.)))))


Back to Index

Similar Entries