I am facing issue in rotation. rotation is working smoothly only for one of the side.
I am using OrbitControls.
I have tried ArcballControls & TrackballControls. but didn’t worked.
Thanks in advance
I am facing issue in rotation. rotation is working smoothly only for one of the side.
I am using OrbitControls.
I have tried ArcballControls & TrackballControls. but didn’t worked.
Thanks in advance
I have added following code to identify drag or click event correctly. previously even with drag mouseClick event was considered.
let isDragging = false;
let mouseDownPosition = new THREE.Vector2();
renderer.domElement.addEventListener("mousedown", (event) => {
mouseDownPosition.set(event.clientX, event.clientY);
isDragging = false;
});
renderer.domElement.addEventListener("mousemove", () => {
isDragging = true;
});
renderer.domElement.addEventListener("mouseup", (event) => {
const mouseUpPosition = new THREE.Vector2(event.clientX, event.clientY);
const distance = mouseUpPosition.distanceTo(mouseDownPosition);
if (distance < 3) {
// Considered a click
onMouseClick(event);
} else {
togglePlayPause(false);
// Considered a drag
}
});
still facing same issue.
This issue is resolved.
Same Post:
thanks @AshhadDevLab