threeModel.vue 810 B

1234567891011121314151617181920212223242526272829303132333435
  1. <template>
  2. <div class="three-model">
  3. <div id="threeModel"></div>
  4. </div>
  5. </template>
  6. <script>
  7. import threeControls from '@/uitls/threeControls';
  8. export default {
  9. name: 'app',
  10. created() {
  11. this.$nextTick(() => {
  12. let threeObj = new threeControls({
  13. container: document.getElementById('threeModel')
  14. });
  15. // threeObj.setAxisHelper();
  16. threeObj.loaderGLTF('https://file-node.oss-cn-shanghai.aliyuncs.com/youji/ec455ebd72664531acfcb81657d44266');
  17. // threeObj.setState();
  18. threeObj.OrbitControls();
  19. // threeObj.inserClickFunc();
  20. // threeObj.initPointerLockControls();
  21. // threeObj.FlyControls();
  22. threeObj.render();
  23. })
  24. }
  25. }
  26. </script>
  27. <style lang="scss">
  28. .three-model,
  29. #threeModel {
  30. width: 100%;
  31. height: 100%;
  32. }
  33. </style>