Scene.pick返回值有偏差

When the camera is far away from the scene, the coordinates returned after the mouse click is inaccurate.
The engine version is 4.2.0-alpha.11

let canvas = document.getElementById(‘renderCanvas’);
let engine = new BABYLON.Engine(canvas, true, {useHighPrecisionFloats: false}, true);
let scene = new BABYLON.Scene(engine);
let camera = new BABYLON.UniversalCamera(“UniversalCamera”, BABYLON.Vector3.Zero(), scene);
scene.onPointerUp = (event, info) => {
let pickResult = scene.pick(scene.pointerX, scene.pointerY);
if (pickResult.hit) {
console.log(pickResult.pickedPoint);
}
};

This is a known issue with realtime rendering. We are losing precision when objects are far from the camera.

Unfortunately the best options are:

  • Move the world and not the camera
  • Or reduce the distance (like divide everything by 100 for instance)

Thank you :smiley: