generate_random_vao   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/examples/external/xtmrender4.xtm

Implementation

(bind-func generate_random_vao
  (lambda (tris)
    (let ((num (* 3 tris))
          (verts:float* (alloc (* 4 num)))
          (normals:float* (alloc (* 3 num)))
          (uvws:float* (alloc (* 3 num)))
          (colours:float* (alloc (* 4 num)))
          (vbo_verts (VBO verts (* 4 num)))
          (vbo_normals (VBO normals (* 3 num)))
          (vbo_uvws (VBO uvws (* 3 num)))
          (vbo_colours (VBO colours (* 4 num)))
          (i 0) (j 0) (k 0))
      ;; random verts
      (dotimes (i num)
        (set! j (* i 4))
        (set! k (* i 3))
        (pset! verts (+ j 0) (- (* (random) 4.0) 2.0))
        (pset! verts (+ j 1) (- (* (random) 4.0) 2.0))
        (pset! verts (+ j 2) (- (* (random) 2.0) 1.0))
        (pset! verts (+ j 3) 1.0))
      ;; generate normals
      (generate_tri_normals verts (* 4 num) normals (* 3 num))
      ;; generate uvws
      (generate_tri_uvws uvws (* 3 num))
      ;; white colour
      (dotimes (i (* 4 num)) (pset! colours i 1.0))
      (set_attribute testVAO vbo_verts 0 4)
      (set_attribute testVAO vbo_normals 1 3)
      (set_attribute testVAO vbo_uvws 2 3)
      (set_attribute testVAO vbo_colours 3 4)
      (update vbo_verts)
      (update vbo_normals)
      (update vbo_uvws)
      (update vbo_colours)
      void)))


Back to Index

Similar Entries

  • PARAM_RANDOM    scheme    /digego/extempore/tree/v0.8.9/libs/core/instruments-scm.xtm
  • PARAM_RANDOM    scheme    /digego/extempore/tree/v0.8.9/examples/sharedsystem/audiosetup.xtm
  • VAO    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects2.xtm
  • VAO_bind_and_draw_arrays    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • VAO_bind_attribute    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • VAO_bind_attribute    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • VAO_create    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • VAO_create_ss_quad    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • VAO_delete    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • VAO_id    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • aiProcess_FindDegenerates    scheme    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • generate_And_Wrap_Pseudorandom_DNA_Sequence    xtlang    /digego/extempore/tree/v0.8.9/examples/core/fasta_lang_shootout.xtm
  • generate_tri_normals    xtlang    /digego/extempore/tree/v0.8.9/examples/external/xtmrender4.xtm
  • generate_tri_uvws    xtlang    /digego/extempore/tree/v0.8.9/examples/external/xtmrender4.xtm
  • get_LCG_Pseudorandom_Number    xtlang    /digego/extempore/tree/v0.8.9/examples/core/fasta_lang_shootout.xtm
  • impc:ti:generate-generic-type-cname    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • init_vao    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/fluids_2d.xtm
  • pc:random    scheme    /digego/extempore/tree/v0.8.9/libs/core/pc_ivl.xtm
  • random    scheme    /digego/extempore/tree/v0.8.9/runtime/scheme.xtm
  • random    xtlang    /digego/extempore/tree/v0.8.9/libs/core/adt.xtm
  • random-next    scheme    /digego/extempore/tree/v0.8.9/runtime/init.xtm
  • xt_pcg32_random    xtlang    /digego/extempore/tree/v0.8.9/libs/core/pcg-rng.xtm
  • xt_pcg32_random_r    xtlang    /digego/extempore/tree/v0.8.9/libs/core/pcg-rng.xtm
  • xt_pcg32_srandom    xtlang    /digego/extempore/tree/v0.8.9/libs/core/pcg-rng.xtm
  • xt_pcg32_srandom_r    xtlang    /digego/extempore/tree/v0.8.9/libs/core/pcg-rng.xtm
  • xtm_draw_vao    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • xtm_draw_vao    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm