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

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

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

灯光

提示

灯光分类为
环境光(AmbientLight) | 方向光(DirectionalLight) | 点光(PointLight) | 半球光(HemisphereLight)

<template>
  <vue3dLoader
    filePath="/models/collada/elf/elf.dae"
    :lights="lights"
    :cameraPosition="{ x: 0, y: 10, z: 10 }"
  />
</template>
<script setup lang="ts">
import { ref } from "vue";
import { vue3dLoader } from "vue-3d-loader";
const lights = ref();
lights.value = [
  {
    type: "AmbientLight",
    color: "red",
  },
  {
    type: "DirectionalLight",
    position: { x: 100, y: 10, z: 100 },
    color: "green",
    intensity: 0.8,
  },
  {
    type: "PointLight",
    color: "#000000",
    position: { x: 200, y: -200, z: 100 },
    intensity: 1,
  },
  {
    type: "HemisphereLight",
    skyColor: "#00FF00",
    groundColor: "#000000",
    position: { x: 200, y: -200, z: 100 },
  },
];
</script>
在 GitHub 上编辑此页
上次更新: 2022/10/30 21:09
Contributors: Tony Tao
Prev
事件
Next
相机位置及旋转