I am doing a fitting point to mark the position to be picked. The desired effect is that the marked point is parallel to the surface of the object.
playground:https://playground.babylonjs.com/#NBK6X6#1
The specific method is to click to select a file to select a model, and then click the upload button.
Move the mouse, the fitting point cannot be parallel to the surface of the object, a solution is needed, thank you.
The expected effect is as follows:
This example should help you make the right calculations:
Just replace line 68 with const normal = pickResult.getNormal(); to use the normal to the picked point instead of the direction of the view to the camera.
Hello, your solution is very important. Based on this solution, I modified the 96 lines of code, and the modified code can solve my problem. Thank you for your help!
before fixing:
const normal = pickInfo.getNormal();
After modification:
const normal = pickInfo.getNormal(true, true);