rotate_matrix   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/external/opengl.xtm

Implementation

(bind-func rotate_matrix
  (lambda (mat:float* alpha:float x:float y:float z:float)
    (let ((c (cos alpha))
          (c-1 (- 1.0 c))
          (s (sin alpha))
          (mat2:float* (salloc 16))
          (mat3:float* (salloc 16))
          (vec1:float* (salloc 3)) ;; axis to rotate around (normalized)
          (vec2:float* (salloc 3))) ;; axis to rotate around (normalized)
      (pfill! vec1 x y z)
      (vnormf vec1 3 vec2)
      (set! x (pref vec2 0))
      (set! y (pref vec2 1))
      (set! z (pref vec2 2))
      (pfill! mat2
              (+ (* x x c-1) c) (- (* x y c-1) (* z s)) (+ (* x z c-1) (* y s)) 0.0
              (+ (* y x c-1) (* z s)) (+ (* y y c-1) c) (- (* y z c-1) (* x s)) 0.0
              (- (* x z c-1) (* y s)) (+ (* y z c-1) (* x s)) (+ (* z z c-1) c) 0.0
              0.0               0.0                     0.0                     1.0)
      ;;(mmulf mat2 4 4 mat 4 4 mat3)
      (mmul4 mat2 mat mat3)
      (memcpy (cast mat i8*) (cast mat3 i8*) (* 16 4))
      void)))


Back to Index

Similar Entries

  • ai_matrix4_to_float    xtlang
  • analogue_get_mod_matrix    xtlang
  • analogue_set_mod_matrix    xtlang
  • cerberus_get_mod_matrix    xtlang
  • cerberus_matrix_cc    xtlang
  • cerberus_set_mod_matrix    xtlang
  • cpTransformRotate    xtlang
  • cpvrotate    xtlang
  • fill_identity_matrix    xtlang
  • fill_identity_matrix    xtlang
  • fill_orthographic_matrix    xtlang
  • fill_orthographic_matrix    xtlang
  • fill_pos_scale_matrix    xtlang
  • fill_projection_matrix    xtlang
  • fill_projection_matrix    xtlang
  • fill_projection_matrix    xtlang
  • fill_view_matrix    xtlang
  • fill_view_matrix    xtlang
  • fill_view_matrix_dir    xtlang
  • fill_view_matrix_dir    xtlang
  • get_mod_matrix    xtlang
  • invert_matrix    xtlang
  • matrix_cc    xtlang
  • reset_view_matrix    xtlang
  • rotate    scheme
  • rotate    xtlang
  • rotate-joint    xtlang
  • rotate_matrix    xtlang
  • scale_matrix    xtlang
  • scale_matrix    xtlang
  • set_mod_matrix    xtlang
  • shader_update_uvwmatrix    xtlang
  • translate_matrix    xtlang
  • translate_matrix    xtlang
  • varotate    xtlang
  • varotate    xtlang
  • vrotate    xtlang
  • xtm_path_rotate    xtlang
  • xtm_path_rotated    xtlang
  • xtm_vgimage_rotate    xtlang
  • xtm_vgimage_rotated    xtlang