OrbitControls Controller in three introduced into vue

three.js.
import * as THREE from "three" installed through npm install three-- save in vue; it can be introduced normally in single file components. The following figure shows a simple cube

clipboard.png
so I want to introduce another controller to realize the camera controller to monitor all angles. This can be achieved through the introduction of script tags in a single HTML page.

<script src="../OrbitControls.js"></script>

var controls = new THREE.OrbitControls(camera);
controls.addEventListener("change", render)
.

question 1: how to introduce this file in the component?
this file is in three/examples/js/controls/OrbitControls.
always does not understand the use of import and export.
question 2: how to translate the sentence import * as THREE from "three"? Is this three a file or something?

Oct.11,2021

just npm I three-OrbitControls directly. Please test today


No one answers?


suggest learning
https://github.com/hujiulong/.
to think about


import {OrbitControls} from 'three/examples/jsm/controls/OrbitControls'

Menu