Vue 3d loaderVue 3d loader
指南
  • English
  • 简体中文
GitHub
指南
  • English
  • 简体中文
GitHub
  • 指南

    • 介绍
    • 快速上手
    • 事件
    • API
    • 捐助
  • 样例

    • 加载一个模型
    • 加载多个模型并单独设置模型位置
    • 加载JSON模型
    • 加载Draco压缩模型
    • 设置场景高宽
    • 材质及纹理
    • 背景颜色及透明度
    • 交互控制
    • 旋转模型
    • 事件
    • 灯光
    • 相机位置及旋转
    • 并行加载多模型
    • 标注
    • 播放/停止动画
    • 开启阻尼
    • 加载进度
    • 控制相机垂直/水平旋转
    • 开启坐标轴及网格
    • 设置摄像头向内外的距离
    • 点光源跟随相机移动
    • 克隆相同模型

相机位置及旋转

<template>
  <vue3dLoader
    filePath="/models/stl/colored.stl"
    @load="onLoad"
    :cameraPosition="positon"
    :cameraRotation="rotation"
  />
</template>
<script setup lang="ts">
import { vue3dLoader } from "vue-3d-loader";
import { ref } from "vue";
const positon = ref();
const rotation = ref();
positon.value = {
  x: -Math.PI / 2,
  y: 0,
  z: 0,
};

rotation.value = {
  x: -Math.PI / 2,
  y: 0,
  z: 0,
};
function onLoad() {
  rotate();
}
function rotate() {
  requestAnimationFrame(rotate);
  rotation.value.z += 0.01;
  positon.value.z += 0.01;
}
</script>
在 GitHub 上编辑此页
上次更新: 2022/10/30 21:09
Contributors: Tony Tao
Prev
灯光
Next
并行加载多模型