Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
632366134 opened this issue Dec 20, 2022 · 0 comments

Comments

@632366134
Copy link

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);
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant