autodesk

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
}

发布者:admin,转转请注明出处:http://www.yc00.com/news/1700116250a984015.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信