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    /digego/extempore/tree/v0.8.9/libs/core/audiobuffer.xtm
  • MATCH-FAILED    scheme    /digego/extempore/tree/v0.8.9/libs/core/pattern.xtm
  • _glib_main_loop_call    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/slideshow.xtm
  • _glib_main_loop_call    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/gstvideo_multi.xtm
  • _glib_main_loop_call    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/gstvideo.xtm
  • _gst_main_loop_call    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/mediaplayer.xtm
  • aiGetMaterialFloat    xtlang    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • aiProcess_CalcTangentSpace    scheme    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • aiProcess_Debone    scheme    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • aiProcess_FindDegenerates    scheme    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • aiProcess_FindInstances    scheme    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • aiProcess_FindInvalidData    scheme    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • aiProcess_FixInfacingNormals    scheme    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • aiProcess_FlipUVs    scheme    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • aiProcess_FlipWindingOrder    scheme    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • aiProcess_GenNormals    scheme    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • aiProcess_GenSmoothNormals    scheme    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • aiProcess_GenUVCoords    scheme    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • aiProcess_ImproveCacheLocality    scheme    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • aiProcess_JoinIdenticalVertices    scheme    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • aiProcess_LimitBoneWeights    scheme    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • aiProcess_MakeLeftHanded    scheme    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • aiProcess_OptimizeGraph    scheme    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • aiProcess_OptimizeMeshes    scheme    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • aiProcess_PreTransformVertices    scheme    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • aiProcess_RemoveComponent    scheme    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • aiProcess_RemoveRedundantMaterials    scheme    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • aiProcess_SortByPType    scheme    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • aiProcess_SplitByBoneCount    scheme    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • aiProcess_SplitLargeMeshes    scheme    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • aiProcess_TransformUVCoords    scheme    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • aiProcess_Triangulate    scheme    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • aiProcess_ValidateDataStructure    scheme    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • ai_build_anim_channel    xtlang    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • ai_build_animation    xtlang    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • ai_build_mesh_vbo    xtlang    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • ai_build_node    xtlang    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • ai_build_scene    xtlang    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • ai_color4_to_float4    xtlang    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • ai_convert    xtlang    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • ai_find_matching_node    xtlang    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • ai_load_ogl_texture    xtlang    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • ai_load_ogl_texture_from_buffer    xtlang    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • ai_matrix4_to_float    xtlang    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • ai_print_export_formats    xtlang    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • aiff_validate    xtlang    /digego/extempore/tree/v0.8.9/libs/core/audiobuffer.xtm
  • audiofile_aiff_read_samples    xtlang    /digego/extempore/tree/v0.8.9/libs/core/audiobuffer.xtm
  • available_midi_events    xtlang    /digego/extempore/tree/v0.8.9/libs/external/midi.xtm
  • await_futures    xtlang    /digego/extempore/tree/v0.8.9/examples/core/xthread.xtm
  • build_pyramid    xtlang    /digego/extempore/tree/v0.8.9/examples/external/xtmrender4.xtm
  • cairo-animation    scheme    /digego/extempore/tree/v0.8.9/examples/contrib/drawing.xtm
  • cairo_draw_image    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/drawing.xtm
  • cerberus_main_cc    xtlang    /digego/extempore/tree/v0.8.9/libs/core/instruments/cerberus_midi.xtm
  • clock_scheduler_main_callback    xtlang    /digego/extempore/tree/v0.8.9/libs/core/scheduler.xtm
  • constrain-generic    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • constrain-genericfunc    macro    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • cpBBContainsBB    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpBB.xtm
  • cpBBContainsVect    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpBB.xtm
  • decompose_domain    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/mpi/random-walk.xtm
  • get_main_frame    xtlang    /digego/extempore/tree/v0.8.9/libs/external/cef/cef.xtm
  • ghttp_set_content_type_plaintext    xtlang    /digego/extempore/tree/v0.8.9/libs/external/ghttp.xtm
  • glfw_print_primary_monitor_details    xtlang    /digego/extempore/tree/v0.8.9/libs/external/glfw3.xtm
  • glfw_print_video_mode_details    xtlang    /digego/extempore/tree/v0.8.9/libs/external/glfw3.xtm
  • glib-main-loop    scheme    /digego/extempore/tree/v0.8.9/examples/contrib/slideshow.xtm
  • glib-main-loop    scheme    /digego/extempore/tree/v0.8.9/examples/contrib/gstvideo_multi.xtm
  • glib_main_loop    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/gstvideo.xtm
  • grains    scheme    /digego/extempore/tree/v0.8.9/examples/external/sing_a_song.xtm
  • gst-main-loop    scheme    /digego/extempore/tree/v0.8.9/examples/contrib/mediaplayer.xtm
  • gui_set_monokai_color_theme    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • gui_set_monokai_opensans_theme    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • impc:aot:insert-closure-binding-details    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:aot:insert-ext-globalvar-binding-details    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:aot:insert-gl-proc-binding-details    scheme    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-getprocaddress.xtm
  • impc:aot:insert-globalvar-binding-details    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:aot:insert-load-dylib-details    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:aot:insert-namedtype-binding-details    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:aot:insert-nativefunc-binding-details    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:aot:insert-polyfunc-binding-details    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:aot:insert-static-binding-details    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:aot:insert-typealias-binding-details    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:aot:insert-xtmacro-binding-details    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:aot:print-compilation-details    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:compiler:print-bind-func-details-to-log    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:compiler:print-binding-details-to-log    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:compiler:print-compiler-failed-error    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:compiler:print-constraint-error    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:compiler:print-dylib-loading-details-to-log    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:compiler:print-lib-binding-details-to-log    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:compiler:print-polying-details-to-log    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:check-bang-against-reified    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:constrain-genericfunc    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:generic-type-details    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:variable-substitution-pairs    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • last-pair    scheme    /digego/extempore/tree/v0.8.9/runtime/init.xtm
  • list-tail    scheme    /digego/extempore/tree/v0.8.9/runtime/init.xtm
  • main    xtlang    /digego/extempore/tree/v0.8.9/examples/core/fasta_lang_shootout.xtm
  • main    xtlang    /digego/extempore/tree/v0.8.9/examples/core/nbody_lang_shootout.xtm
  • main    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/opencl.xtm
  • main    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/80211.xtm
  • main    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/mpi/mpitest.xtm
  • main    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/mpi/send-recv.xtm
  • main    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/mpi/random-walk.xtm
  • main    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/mpi/hello-world.xtm
  • main    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/mpi/reduce-average.xtm
  • main    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/mpi/ping-pong.xtm
  • main    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/extempore-fortran/simulation.xtm
  • mainLoop    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/horde3d_knight.xtm
  • mainLoop    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/bullet.xtm
  • main_cc    xtlang    /digego/extempore/tree/v0.8.9/libs/core/instruments/analogue_midi.xtm
  • main_gain    xtlang    /digego/extempore/tree/v0.8.9/examples/sharedsystem/audiosetup.xtm
  • main_reverb    xtlang    /digego/extempore/tree/v0.8.9/examples/sharedsystem/audiosetup.xtm
  • match-pair    scheme    /digego/extempore/tree/v0.8.9/libs/core/pattern.xtm
  • match_aiString    xtlang    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • nth_tail    xtlang    /digego/extempore/tree/v0.8.9/libs/core/adt.xtm
  • nth_tailr    xtlang    /digego/extempore/tree/v0.8.9/libs/core/adt.xtm
  • ocv_waitKey    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/xtmcv.xtm
  • p:pair    scheme    /digego/extempore/tree/v0.8.9/libs/base/pattern.xtm
  • pairs_test    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/algebraic_data_types.xtm
  • run_main_event_loop    xtlang    /digego/extempore/tree/v0.8.9/libs/core/scheduler.xtm
  • set_cairo_source_with_colour    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/spectral_meter.xtm
  • set_dl_main    xtlang    /digego/extempore/tree/v0.8.9/libs/core/instruments/dlogue.xtm
  • sys:wait    scheme    /digego/extempore/tree/v0.8.9/runtime/scheme.xtm
  • tail    scheme    /digego/extempore/tree/v0.8.9/runtime/init.xtm
  • xtm_build_mesh_vbo    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • xtm_destroy_paint    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/openvg.xtm
  • xtm_draw_mesh    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • xtm_draw_mesh    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • xtm_mesh_ambient    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • xtm_mesh_diffuse    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • xtm_mesh_emissive    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • xtm_mesh_opacity    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • xtm_mesh_shininess    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • xtm_mesh_specular    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • xtm_model_mesh    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • xtm_paint_set_color    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/openvg.xtm
  • xtm_paint_set_fill    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/openvg.xtm
  • xtm_paint_set_pattern    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/openvg.xtm
  • xtm_paint_set_stroke    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/openvg.xtm
  • zip_array_ptr_constraint    scheme    /digego/extempore/tree/v0.8.9/tests/core/constraints.xtm
  • zip_array_val_constraint    scheme    /digego/extempore/tree/v0.8.9/tests/core/constraints.xtm