How to get the 3d position of mouse in 3D Models?

  • How to get the 3d position of mouse in 3D Models?


    Klaus,

    I use screentosphere function and get the space coordinate by spheretospace. But unfortunately, the position is very different.there is other way to get the 3d position of mouse or achieve hit test?

  • Hi,

    there is no such as a '3d position of a mouse' - the mouse has only a 2d position on the screen.

    For hit-testing a ray, projected from the view/camera-center to the mouse cursor position, need to be tested against each triangle of a 3d model. And when the ray and the triangle hit, it would be possible to calculate a 3d position.

    krpano support such hit-testing for hotspots, but not for 3d-models yet.

    Best regards,
    Klaus

  • Hi,

    there is no such as a '3d position of a mouse' - the mouse has only a 2d position on the screen.

    For hit-testing a ray, projected from the view/camera-center to the mouse cursor position, need to be tested against each triangle of a 3d model. And when the ray and the triangle hit, it would be possible to calculate a 3d position.

    krpano support such hit-testing for hotspots, but not for 3d-models yet.

    Best regards,
    Klaus


    Hi Klaus,
    Can you tell me about how to click model(Threejs integration), i tried to add latest threejs your way on old version, it shows but onclick event doesn't happen. I think camera_hittest_raycaster is not working properly. Could you take a moment to look into this?
    Thanks. *smile*

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!