autodesk
源码部分,不晓得咋调
var that = this;(function animate() {if (that.recordTime) {requestAnimationFrame(animate);}// Is there an assumption here about the order of animation frame callbacks?var now = Date.now();deltaTime = now - startTime;startTime = now;})();
自己实现方法
setInterval("zizhuan()",100)function zizhuan() {const nav = this.viewer.navigationconst up = nav.getCameraUpVector()const pos = nav.getPosition()const axis = new THREE.Vector3(0, 0, -1)const speed = 5.0 * Math.PI / 180const dt = getElapsedMs() * 0.001const matrix = new THREE.Matrix4().makeRotationAxis(axis, speed * dt)pos.applyMatrix4(matrix)up.applyMatrix4(matrix)nav.setView(pos, new THREE.Vector3(0, 0, 0))nav.setCameraUpVector(up)
}
var _lastTime = performance.now()function getElapsedMs () {var time = performance.now()var elapsedMs = time - this._lastTimethis._lastTime = timereturn elapsedMs
}
autodesk
源码部分,不晓得咋调
var that = this;(function animate() {if (that.recordTime) {requestAnimationFrame(animate);}// Is there an assumption here about the order of animation frame callbacks?var now = Date.now();deltaTime = now - startTime;startTime = now;})();
自己实现方法
setInterval("zizhuan()",100)function zizhuan() {const nav = this.viewer.navigationconst up = nav.getCameraUpVector()const pos = nav.getPosition()const axis = new THREE.Vector3(0, 0, -1)const speed = 5.0 * Math.PI / 180const dt = getElapsedMs() * 0.001const matrix = new THREE.Matrix4().makeRotationAxis(axis, speed * dt)pos.applyMatrix4(matrix)up.applyMatrix4(matrix)nav.setView(pos, new THREE.Vector3(0, 0, 0))nav.setCameraUpVector(up)
}
var _lastTime = performance.now()function getElapsedMs () {var time = performance.now()var elapsedMs = time - this._lastTimethis._lastTime = timereturn elapsedMs
}