vue-three-sdt

vue3加载3d模型以及基本的增删改查
2,356
Install
npm install vue-three-sdt
Latest Version:2.1.13
Vue:3
Older releases:2
Last Updated:Dec 13, 2022
Links: npm
Maintainer: zhy-jn

vue-three-sdt

一个支持Vue3的展示三维模型的Vue组件,支持fbx,glb,json文件。 ##2.1.0 优化代码

2.0.7

修复动画类报错问题

2.0.6

增加点击风门等模型显示弹窗,组件参数dataMes(风门等),windDataMes(传感器) 去除自动添加风门等模型,添加风门等模型返回参数中添加setModelType参数,调用class类editModel中的addSmallModel方法 传参{x: event.point.x,y: event.point.y,z: event.point.z},event.object,event.setModelType,{自定义数据} 添加后模型增加modelMes参数

2.0.5

修复材质警告

2.0.1

1.添加巷道时根据原巷道材质设置新增巷道 2.修改节点材质 3.增加基础模型大小,standSize,默认为1 4.合并两个工具类editModel.js和subVectors.js,拆分editModel.js为animModel.js和editModel.js 5.新增将FBX转为json

Install

using npm

npm i vue-three-sdt

使用

<template>
  <model-minix src="example/models/obj/LeePerrySmith.obj"></model-minix>
</template>
<script>
import { modelMinix } from 'vue-three-sdt';
export default {
  components: { modelMinix }
}
</script>

Documents

props

prop type default example
src string - './exapmle.obj'
width number - 300
height number - 300
position object { x: 0, y: 0, z: 0 } { x: 100, y: 20, z: -10 }
rotation object { x: 0, y: 0, z: 0 } { x: Math.PI / 2, y: 0, z: - Math.PI / 4 }
cameraPosition object { x: 0, y: 0, z: 0 } { x: 1, y: 2, z: -3 }
cameraRotation object { x: 0, y: 0, z: 0 } { x: 3, y: 2, z: -1 }
scale object { x: 1, y: 1, z: 1 } { x: 2, y: 2, z: 3 }
lights array -
backgroundColor number/string 0xffffff 0xffffff/'#f00'/'rgb(255,255,255)'
backgroundAlpha number 1 0.5
controlsOptions object - see OrbitControls Properties
crossOrigin string anonymous anonymous/use-credentials
outputEncoding number THREE.LinearEncoding see WebGLRenderer OutputEncoding
glOptions object { antialias: true, alpha: true } see WebGLRenderer Parameters
labelList Array [] 风量数据 [{text: '32m³/min',name: '120-119', num: 32}]
isEdit Boolean false 是否开启编辑页面
rwColorNums Array [261.3, 52.8, 27.5, 9.6, 0.6, 0] 根据风量改变巷道颜色

events

event
on-click
on-load
on-progress
on-error
on-dblclick
end-draw
on-cartoon
on-model
delete-model
save-model

Version History

Version Released Vue License
2.1.13 3.2.45
2.1.12 3.2.41
2.1.11 3.2.41
2.1.10 3.2.41
2.1.9 3.2.41