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    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • analogue_get_mod_matrix    xtlang    /digego/extempore/tree/v0.8.9/libs/core/instruments/instrument_params.xtm
  • analogue_set_mod_matrix    xtlang    /digego/extempore/tree/v0.8.9/libs/core/instruments/instrument_params.xtm
  • cerberus_get_mod_matrix    xtlang    /digego/extempore/tree/v0.8.9/libs/core/instruments/instrument_params.xtm
  • cerberus_matrix_cc    xtlang    /digego/extempore/tree/v0.8.9/libs/core/instruments/cerberus_midi.xtm
  • cerberus_set_mod_matrix    xtlang    /digego/extempore/tree/v0.8.9/libs/core/instruments/instrument_params.xtm
  • cpTransformRotate    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpTransform.xtm
  • cpvrotate    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpVect.xtm
  • fill_identity_matrix    xtlang    /digego/extempore/tree/v0.8.9/libs/external/opengl.xtm
  • fill_identity_matrix    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • fill_orthographic_matrix    xtlang    /digego/extempore/tree/v0.8.9/libs/external/opengl.xtm
  • fill_orthographic_matrix    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • fill_pos_scale_matrix    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • fill_projection_matrix    xtlang    /digego/extempore/tree/v0.8.9/libs/external/opengl.xtm
  • fill_projection_matrix    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • fill_projection_matrix    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • fill_view_matrix    xtlang    /digego/extempore/tree/v0.8.9/libs/external/opengl.xtm
  • fill_view_matrix    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • fill_view_matrix_dir    xtlang    /digego/extempore/tree/v0.8.9/libs/external/opengl.xtm
  • fill_view_matrix_dir    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • get_mod_matrix    xtlang    /digego/extempore/tree/v0.8.9/libs/core/instruments/instrument_params.xtm
  • invert_matrix    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • matrix_cc    xtlang    /digego/extempore/tree/v0.8.9/libs/core/instruments/analogue_midi.xtm
  • reset_view_matrix    xtlang    /digego/extempore/tree/v0.8.9/examples/external/shader-tutorials/triangle.xtm
  • rotate    scheme    /digego/extempore/tree/v0.8.9/runtime/scheme.xtm
  • rotate    xtlang    /digego/extempore/tree/v0.8.9/libs/core/adt.xtm
  • rotate-joint    xtlang    /digego/extempore/tree/v0.8.9/libs/external/horde3d.xtm
  • rotate_matrix    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • scale_matrix    xtlang    /digego/extempore/tree/v0.8.9/libs/external/opengl.xtm
  • scale_matrix    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • set_mod_matrix    xtlang    /digego/extempore/tree/v0.8.9/libs/core/instruments/instrument_params.xtm
  • shader_update_uvwmatrix    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • translate_matrix    xtlang    /digego/extempore/tree/v0.8.9/libs/external/opengl.xtm
  • translate_matrix    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • varotate    xtlang    /digego/extempore/tree/v0.8.9/libs/core/math.xtm
  • varotate    xtlang    /digego/extempore/tree/v0.8.9/libs/core/math.xtm
  • vrotate    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/TSM_library.xtm
  • xtm_path_rotate    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/openvg.xtm
  • xtm_path_rotated    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/openvg.xtm
  • xtm_vgimage_rotate    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/openvg.xtm
  • xtm_vgimage_rotated    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/openvg.xtm