ai_build_mesh   xtlang


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

Implementation

(bind-func ai_build_mesh
  (lambda (scene:aiScene* mesh:aiMesh* xmesh:XTMMesh* dir:i8*)
    ;; (printf "\tBuild Mesh\n")
    (let ((facemode:i32* (salloc))
          (vbo:VBO* null)
          (vao:VAO* (VAO))
          (color:aiColor4D* (salloc))
          (val:float* (salloc))
          (diffuse:float* (halloc 4))
          (ambient:float* (halloc 4))
          (specular:float* (halloc 4))
          (emissive:float* (halloc 4))
          (material_index (tref mesh 13))
          (material (pref (tref scene 5) material_index))
          ;; (texid 0)
          (diffuse_tex:Texture* null)
          (normal_tex:Texture* null)
          (specular_tex:Texture* null)
          (height_tex:Texture* null)
          (texfile:aiString* (salloc))
          (name:aiString* (tref-ptr mesh 14)))
      (set! vbo (ai_build_mesh_vbo vao mesh xmesh facemode))
      (tset! xmesh 0 vbo)
      (set! diffuse_tex (load_assim_material_texture scene material aiTextureType_DIFFUSE dir))
      (set! specular_tex (load_assim_material_texture scene material aiTextureType_SPECULAR dir))
      (set! height_tex (load_assim_material_texture scene material aiTextureType_HEIGHT dir))
      (set! normal_tex (load_assim_material_texture scene material aiTextureType_NORMALS dir))
      (tset! xmesh 1 diffuse_tex)
      (tset! xmesh 15 diffuse_tex)
      (tset! xmesh 16 specular_tex)
      (tset! xmesh 17 height_tex)
      (tset! xmesh 18 normal_tex)
      (if (= (aiGetMaterialColor material "$clr.diffuse" 0 0 color) 0)
          (ai_color4_to_float4 color diffuse))
      (tset! xmesh 2 diffuse)
      (if (= (aiGetMaterialColor material "$clr.ambient" 0 0 color) 0)
          (ai_color4_to_float4 color ambient))
      (tset! xmesh 3 ambient)
      (if (= (aiGetMaterialColor material "$clr.specular" 0 0 color) 0)
          (ai_color4_to_float4 color specular))
      (tset! xmesh 4 specular)
      (if (= (aiGetMaterialColor material "$clr.emissive" 0 0 color) 0)
          (ai_color4_to_float4 color emissive))
      (tset! xmesh 5 emissive)
      (if (= (aiGetMaterialFloat material "$mat.shininess" 0 0 val) 0)
          (begin (tset! xmesh 6 (pref val 0)) 1)
          (begin (tset! xmesh 6 0.0) 1))
      (if (= (aiGetMaterialFloat material "$mat.opacity" 0 0 val) 0)
          (begin (tset! xmesh 7 (pref val 0)) 1)
          (begin (tset! xmesh 7 0.0) 1))
      (tset! xmesh 8 (pref facemode 0))
      (tset! xmesh 9 (elements vbo))
      (tset! xmesh 10 vao)
      (tset! xmesh 11 (Str (cast (tref-ptr name 1) i8*)))
      void)))


Back to Index

Similar Entries

  • AudioBuffer_from_aiff    xtlang
  • MATCH-FAILED    scheme
  • _glib_main_loop_call    xtlang
  • _glib_main_loop_call    xtlang
  • _glib_main_loop_call    xtlang
  • _gst_main_loop_call    xtlang
  • aiGetMaterialFloat    xtlang
  • aiProcess_CalcTangentSpace    scheme
  • aiProcess_Debone    scheme
  • aiProcess_FindDegenerates    scheme
  • aiProcess_FindInstances    scheme
  • aiProcess_FindInvalidData    scheme
  • aiProcess_FixInfacingNormals    scheme
  • aiProcess_FlipUVs    scheme
  • aiProcess_FlipWindingOrder    scheme
  • aiProcess_GenNormals    scheme
  • aiProcess_GenSmoothNormals    scheme
  • aiProcess_GenUVCoords    scheme
  • aiProcess_ImproveCacheLocality    scheme
  • aiProcess_JoinIdenticalVertices    scheme
  • aiProcess_LimitBoneWeights    scheme
  • aiProcess_MakeLeftHanded    scheme
  • aiProcess_OptimizeGraph    scheme
  • aiProcess_OptimizeMeshes    scheme
  • aiProcess_PreTransformVertices    scheme
  • aiProcess_RemoveComponent    scheme
  • aiProcess_RemoveRedundantMaterials    scheme
  • aiProcess_SortByPType    scheme
  • aiProcess_SplitByBoneCount    scheme
  • aiProcess_SplitLargeMeshes    scheme
  • aiProcess_TransformUVCoords    scheme
  • aiProcess_Triangulate    scheme
  • aiProcess_ValidateDataStructure    scheme
  • ai_build_anim_channel    xtlang
  • ai_build_animation    xtlang
  • ai_build_mesh_vbo    xtlang
  • ai_build_node    xtlang
  • ai_build_scene    xtlang
  • ai_color4_to_float4    xtlang
  • ai_convert    xtlang
  • ai_find_matching_node    xtlang
  • ai_load_ogl_texture    xtlang
  • ai_load_ogl_texture_from_buffer    xtlang
  • ai_matrix4_to_float    xtlang
  • ai_print_export_formats    xtlang
  • aiff_validate    xtlang
  • audiofile_aiff_read_samples    xtlang
  • available_midi_events    xtlang
  • await_futures    xtlang
  • build_pyramid    xtlang
  • cairo-animation    scheme
  • cairo_draw_image    xtlang
  • cerberus_main_cc    xtlang
  • clock_scheduler_main_callback    xtlang
  • constrain-generic    scheme
  • constrain-genericfunc    macro
  • cpBBContainsBB    xtlang
  • cpBBContainsVect    xtlang
  • decompose_domain    xtlang
  • get_main_frame    xtlang
  • ghttp_set_content_type_plaintext    xtlang
  • glfw_print_primary_monitor_details    xtlang
  • glfw_print_video_mode_details    xtlang
  • glib-main-loop    scheme
  • glib-main-loop    scheme
  • glib_main_loop    xtlang
  • grains    scheme
  • gst-main-loop    scheme
  • gui_set_monokai_color_theme    xtlang
  • gui_set_monokai_opensans_theme    xtlang
  • impc:aot:insert-closure-binding-details    scheme
  • impc:aot:insert-ext-globalvar-binding-details    scheme
  • impc:aot:insert-gl-proc-binding-details    scheme
  • impc:aot:insert-globalvar-binding-details    scheme
  • impc:aot:insert-load-dylib-details    scheme
  • impc:aot:insert-namedtype-binding-details    scheme
  • impc:aot:insert-nativefunc-binding-details    scheme
  • impc:aot:insert-polyfunc-binding-details    scheme
  • impc:aot:insert-static-binding-details    scheme
  • impc:aot:insert-typealias-binding-details    scheme
  • impc:aot:insert-xtmacro-binding-details    scheme
  • impc:aot:print-compilation-details    scheme
  • impc:compiler:print-bind-func-details-to-log    scheme
  • impc:compiler:print-binding-details-to-log    scheme
  • impc:compiler:print-compiler-failed-error    scheme
  • impc:compiler:print-constraint-error    scheme
  • impc:compiler:print-dylib-loading-details-to-log    scheme
  • impc:compiler:print-lib-binding-details-to-log    scheme
  • impc:compiler:print-polying-details-to-log    scheme
  • impc:ti:check-bang-against-reified    scheme
  • impc:ti:constrain-genericfunc    scheme
  • impc:ti:generic-type-details    scheme
  • impc:ti:variable-substitution-pairs    scheme
  • last-pair    scheme
  • list-tail    scheme
  • main    xtlang
  • main    xtlang
  • main    xtlang
  • main    xtlang
  • main    xtlang
  • main    xtlang
  • main    xtlang
  • main    xtlang
  • main    xtlang
  • main    xtlang
  • main    xtlang
  • mainLoop    xtlang
  • mainLoop    xtlang
  • main_cc    xtlang
  • main_gain    xtlang
  • main_reverb    xtlang
  • match-pair    scheme
  • match_aiString    xtlang
  • nth_tail    xtlang
  • nth_tailr    xtlang
  • ocv_waitKey    xtlang
  • p:pair    scheme
  • pairs_test    xtlang
  • run_main_event_loop    xtlang
  • set_cairo_source_with_colour    xtlang
  • set_dl_main    xtlang
  • sys:wait    scheme
  • tail    scheme
  • xtm_build_mesh_vbo    xtlang
  • xtm_destroy_paint    xtlang
  • xtm_draw_mesh    xtlang
  • xtm_draw_mesh    xtlang
  • xtm_mesh_ambient    xtlang
  • xtm_mesh_diffuse    xtlang
  • xtm_mesh_emissive    xtlang
  • xtm_mesh_opacity    xtlang
  • xtm_mesh_shininess    xtlang
  • xtm_mesh_specular    xtlang
  • xtm_model_mesh    xtlang
  • xtm_paint_set_color    xtlang
  • xtm_paint_set_fill    xtlang
  • xtm_paint_set_pattern    xtlang
  • xtm_paint_set_stroke    xtlang
  • zip_array_ptr_constraint    scheme
  • zip_array_val_constraint    scheme