Closed yukangyang closed 1 year ago
<template> <div> <vue3dLoader :height="200" :width="200" @load="onLoad" :filePath="['/model/Duck/Duck.gltf']" :rotation="rotation" ></vue3dLoader> </div> </template> <script> export default { name: 'vuedtest', data() { return { rotation: { x: 0, y: 0, z: 0 } } }, methods: { onLoad() { this.rotate() }, rotate() { requestAnimationFrame(rotate); rotation.z -= 0.01; } } } </script> <style scoped> </style>
代码有误,请查看关于vue2 的 demo代码:https://github.com/king2088/vue-3d-loader/blob/1.2.x/src/examples/rotate-model.vue
感谢感谢😁😁😁😘😘😘
成功了,记得给个start,谢谢