THREE.js + 语音识别控制

THREE.js + 语音识别控制

概述

如有不明白的可以加QQ:2781128388
源码获取: https://mbd.pub/o/bread/Y5uck5ly

使用aframe加载模型,然后使用语音识别功能对模型进行控制,模型可做起跳,奔跑等动作,详细请看视频:

Three.js + 语音识别控制模型动画

aframe核心代码

  <a-scene>
    <div class="dropdown">
      <el-select v-model="walkAnimation" placeholder="请选择">
        <el-option v-for="(item, key) in animate" :key="key" :label="item" :value="key">
        </el-option>
      </el-select>
    </div>
    <div class="voice">
      <el-button @click="startVoice" type="primary" round>{
   
   { text }}</el-button>
    </div>
    <a-sky src="sky.jpg"> </a-sky>
    <a-entity id="walker2" position="0 0 -5" visible="true">
      <a-entity
        gltf-model="model/dino.glb"
        id="dino"
        scale="1.5 1.5 1.5"
        animation-mixer="clip:Idle"
        rotation="0 90 0"
        shadow="cast: true"
      >
      </a-entity>
    </a-entity>
  </a-scene>

猜你喜欢

转载自blog.csdn.net/qq_39503511/article/details/121179669
今日推荐