three-platformize icon indicating copy to clipboard operation
three-platformize copied to clipboard

微信小程序ar环境下,OrbitControls无法使用并且会导致帧数下降

Open 632366134 opened this issue 3 years ago • 0 comments

import { OrbitControls } from "three-platformize/examples/jsm/controls/OrbitControls"; this.camera =new THREE.PerspectiveCamera(20, this.canvas.width / this.canvas.height, 1, 10000); const renderer = (this.renderer = new THREE.WebGL1Renderer({ antialias: true, alpha: true, canvas: this.canvas, })); this.orbitControl = new OrbitControls(this.camera, renderer.domElement); this.orbitControl.enableDamping = true; this.orbitControl.dampingFactor = 0.05;

const onFrame = (timestamp) => { // let start = Date.now() const frame = session.getVKFrame(canvas.width, canvas.height); if (frame) { this.render(frame); } this.orbitControl?.update() session.requestAnimationFrame(onFrame); }; session.requestAnimationFrame(onFrame);

canvas绑定事件 onTX(e) { this.platform.dispatchTouchEvent(e); },

632366134 avatar Dec 20 '22 07:12 632366134