draw_scene   xtlang


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

Implementation

(bind-func draw_scene
  (lambda (degree shader model:float* view:float* projection:float*)
    (let ((mata:float* (salloc 4))
          (matd:float* (salloc 4))
          (mats:float* (salloc 4))
          (tmp_matrix:float* (salloc 16)))
      (pfill! mata 0.0 0.0 0.0 1.0)
      (pfill! matd 0.0 0.0 1.0 1.0)
      (pfill! mats 1.0 1.0 1.0 1.0)
      (shader_update_material shader mata matd mats 50.0)
      ;; static cube
      (shader_update_matrices shader model view projection)
      (cube_whole)
      ;; rotating cube
      (mcopy model 4 4 tmp_matrix) ;; like pushing matrix i.e. (glPushMatrix)
      (translate_matrix model -2.0 0.0 1.0)
      (translate_matrix model 0.5 0.5 0.5)
      (rotate_matrix model (dtof (* 0.1 degree)) 1.0 1.0 1.0)
      (translate_matrix model -0.5 -0.5 -0.5)
      (shader_update_matrices shader model view projection)
      (cube_whole)
      (mcopy tmp_matrix 4 4 model) ;; like popping matrix
      ;; sphere 1
      (translate_matrix model 1.0 2.0 -2.0)
      (shader_update_matrices shader model view projection)
      (glutSolidSphere 1.0 50 50)
      ;; sometimes easier just to reverse something
      ;; rather than copying the matrix
      (translate_matrix model -1.0 -2.0 2.0)
      ;; wall colour
      (pfill! mata 0.0 0.0 0.0 1.0)
      (pfill! matd 1.0 0.3 0.2 1.0)
      (pfill! mats 0.5 0.5 0.5 1.0)
      (shader_update_material shader mata matd mats 50.0)
      ;; backwall
      (mcopy model 4 4 tmp_matrix)
      (translate_matrix model -5.0 -2.0 -5.0)
      (scale_matrix model 10.0 10.0 0.01)
      (shader_update_matrices shader model view projection)
      (cube_whole)
      (mcopy tmp_matrix 4 4 model)
      ;; floor
      (mcopy model 4 4 tmp_matrix)
      (translate_matrix model -5.0 -2.0 -5.0)
      (scale_matrix model 10.0 0.01 10.0)
      (shader_update_matrices shader model view projection)
      (cube_whole)
      (mcopy tmp_matrix 4 4 model)
      void)))


Back to Index

Similar Entries

  • VAO_bind_and_draw_arrays    xtlang
  • ai_build_scene    xtlang
  • cairo_draw_image    xtlang
  • draw    xtlang
  • draw    xtlang
  • draw-skeleton    xtlang
  • draw_a_circle    xtlang
  • draw_a_circle    xtlang
  • draw_a_line    xtlang
  • draw_a_line    xtlang
  • draw_barplot    xtlang
  • draw_color_body_frame    xtlang
  • draw_color_body_frame_with_hands    xtlang
  • draw_frame    xtlang
  • draw_frame    xtlang
  • draw_frame    xtlang
  • draw_quad    xtlang
  • draw_rgb_frame    xtlang
  • draw_scatterplot    xtlang
  • draw_seg    xtlang
  • draw_spectral_bar    xtlang
  • draw_spectrum_key    xtlang
  • dv_draw_axes_2D    xtlang
  • dv_draw_axis_labels_2D    xtlang
  • dv_draw_bars    xtlang
  • dv_draw_line    xtlang
  • dv_draw_line_segments    xtlang
  • dv_draw_scatter_points    xtlang
  • dv_draw_scatter_points    xtlang
  • dv_draw_title    xtlang
  • gl-draw    xtlang
  • gl_draw    xtlang
  • gl_draw    xtlang
  • gl_draw    xtlang
  • gl_draw    xtlang
  • gl_draw    xtlang
  • gl_draw    xtlang
  • gl_draw    xtlang
  • gl_draw    xtlang
  • gl_draw    xtlang
  • gl_draw    xtlang
  • gl_draw    xtlang
  • gl_draw_arrows    xtlang
  • gl_draw_loop    xtlang
  • gl_draw_loop    xtlang
  • gl_draw_loop    xtlang
  • gl_draw_loop    xtlang
  • gl_draw_loop    xtlang
  • gl_draw_loop    xtlang
  • gl_draw_loop    xtlang
  • gl_draw_loop    xtlang
  • gl_draw_loop    xtlang
  • gl_draw_loop    xtlang
  • gl_draw_loop    xtlang
  • gl_draw_loop    xtlang
  • gl_draw_loop    xtlang
  • gl_draw_loop    xtlang
  • gl_draw_particles    xtlang
  • gui_draw_circle    xtlang
  • gui_draw_rect    xtlang
  • gui_draw_text_in_bounds    xtlang
  • init_draw_quad    xtlang
  • nvg_draw_loop    xtlang
  • nvg_draw_loop    xtlang
  • nvg_draw_loop    xtlang
  • nvg_draw_loop    xtlang
  • nvg_draw_text    xtlang
  • psystem_draw    xtlang
  • psystem_draw    xtlang
  • scene    scheme
  • scene    scheme
  • shader_prepare_draw    xtlang
  • shader_prepare_draw    xtlang
  • shader_prepare_draw    xtlang
  • shader_prepare_draw    xtlang
  • shader_prepare_draw    xtlang
  • xtm_draw_arc    xtlang
  • xtm_draw_arc_fill    xtlang
  • xtm_draw_arc_fill    xtlang
  • xtm_draw_arc_fill    xtlang
  • xtm_draw_arc_fill    xtlang
  • xtm_draw_arc_fill    xtlang
  • xtm_draw_arc_fill    xtlang
  • xtm_draw_arc_fill    xtlang
  • xtm_draw_arc_fill    xtlang
  • xtm_draw_arc_stroke    xtlang
  • xtm_draw_arc_stroke    xtlang
  • xtm_draw_arc_stroke    xtlang
  • xtm_draw_arc_stroke    xtlang
  • xtm_draw_arc_stroke    xtlang
  • xtm_draw_arc_stroke    xtlang
  • xtm_draw_arc_stroke    xtlang
  • xtm_draw_arc_stroke    xtlang
  • xtm_draw_arcd    xtlang
  • xtm_draw_bezier_fill    xtlang
  • xtm_draw_bezier_fill    xtlang
  • xtm_draw_bezier_fill    xtlang
  • xtm_draw_bezier_fill    xtlang
  • xtm_draw_bezier_stroke    xtlang
  • xtm_draw_bezier_stroke    xtlang
  • xtm_draw_bezier_stroke    xtlang
  • xtm_draw_bezier_stroke    xtlang
  • xtm_draw_circle_fill    xtlang
  • xtm_draw_circle_fill    xtlang
  • xtm_draw_circle_fill    xtlang
  • xtm_draw_circle_fill    xtlang
  • xtm_draw_circle_stroke    xtlang
  • xtm_draw_circle_stroke    xtlang
  • xtm_draw_circle_stroke    xtlang
  • xtm_draw_circle_stroke    xtlang
  • xtm_draw_ellipse    xtlang
  • xtm_draw_ellipse_fill    xtlang
  • xtm_draw_ellipse_fill    xtlang
  • xtm_draw_ellipse_fill    xtlang
  • xtm_draw_ellipse_fill    xtlang
  • xtm_draw_ellipse_stroke    xtlang
  • xtm_draw_ellipse_stroke    xtlang
  • xtm_draw_ellipse_stroke    xtlang
  • xtm_draw_ellipse_stroke    xtlang
  • xtm_draw_ellipsed    xtlang
  • xtm_draw_line    xtlang
  • xtm_draw_line    xtlang
  • xtm_draw_line    xtlang
  • xtm_draw_line    xtlang
  • xtm_draw_line    xtlang
  • xtm_draw_lined    xtlang
  • xtm_draw_mesh    xtlang
  • xtm_draw_mesh    xtlang
  • xtm_draw_model    xtlang
  • xtm_draw_model    xtlang
  • xtm_draw_path    xtlang
  • xtm_draw_path_keep    xtlang
  • xtm_draw_poly    xtlang
  • xtm_draw_polyd    xtlang
  • xtm_draw_quad    xtlang
  • xtm_draw_quad_fill    xtlang
  • xtm_draw_quad_fill    xtlang
  • xtm_draw_quad_fill    xtlang
  • xtm_draw_quad_fill    xtlang
  • xtm_draw_quad_stroke    xtlang
  • xtm_draw_quad_stroke    xtlang
  • xtm_draw_quad_stroke    xtlang
  • xtm_draw_quad_stroke    xtlang
  • xtm_draw_quadd    xtlang
  • xtm_draw_rect    xtlang
  • xtm_draw_rect_fill    xtlang
  • xtm_draw_rect_fill    xtlang
  • xtm_draw_rect_fill    xtlang
  • xtm_draw_rect_fill    xtlang
  • xtm_draw_rect_stroke    xtlang
  • xtm_draw_rect_stroke    xtlang
  • xtm_draw_rect_stroke    xtlang
  • xtm_draw_rect_stroke    xtlang
  • xtm_draw_rectd    xtlang
  • xtm_draw_round_rect    xtlang
  • xtm_draw_round_rectd    xtlang
  • xtm_draw_rounded_rect_fill    xtlang
  • xtm_draw_rounded_rect_fill    xtlang
  • xtm_draw_rounded_rect_fill    xtlang
  • xtm_draw_rounded_rect_fill    xtlang
  • xtm_draw_rounded_rect_stroke    xtlang
  • xtm_draw_rounded_rect_stroke    xtlang
  • xtm_draw_rounded_rect_stroke    xtlang
  • xtm_draw_rounded_rect_stroke    xtlang
  • xtm_draw_rounded_rect_varying_fill    xtlang
  • xtm_draw_rounded_rect_varying_fill    xtlang
  • xtm_draw_rounded_rect_varying_fill    xtlang
  • xtm_draw_rounded_rect_varying_fill    xtlang
  • xtm_draw_rounded_rect_varying_stroke    xtlang
  • xtm_draw_rounded_rect_varying_stroke    xtlang
  • xtm_draw_rounded_rect_varying_stroke    xtlang
  • xtm_draw_rounded_rect_varying_stroke    xtlang
  • xtm_draw_tex    xtlang
  • xtm_draw_tex    xtlang
  • xtm_draw_tex    xtlang
  • xtm_draw_tex    xtlang
  • xtm_draw_tex    xtlang
  • xtm_draw_tex    xtlang
  • xtm_draw_tex    xtlang
  • xtm_draw_tri    xtlang
  • xtm_draw_tri_fill    xtlang
  • xtm_draw_tri_fill    xtlang
  • xtm_draw_tri_fill    xtlang
  • xtm_draw_tri_fill    xtlang
  • xtm_draw_tri_stroke    xtlang
  • xtm_draw_tri_stroke    xtlang
  • xtm_draw_tri_stroke    xtlang
  • xtm_draw_tri_stroke    xtlang
  • xtm_draw_trid    xtlang
  • xtm_draw_vao    xtlang
  • xtm_draw_vao    xtlang
  • xtm_draw_vgimage    xtlang
  • xtm_scale_and_draw_vgimage    xtlang
  • xtm_scale_and_draw_vgimaged    xtlang