brianzinn / react-babylonjs

React for Babylon 3D engine
https://brianzinn.github.io/react-babylonjs/
818 stars 105 forks source link

Get clicked point on the model - React Babylon JS #153

Closed SurajMK94 closed 2 years ago

SurajMK94 commented 2 years ago

Hi team,

How can i get the vector3 coordinate of the mouse clicked point on the 3D model in React Babylon JS code?

Thanks and Regards, Suraj M K

brianzinn commented 2 years ago

here is a code sandbox: https://codesandbox.io/s/quizzical-cache-8ytn4?file=/src/App.tsx pointer-down-vector

brianzinn commented 2 years ago

Please re-open if above solution does not work for you.

SurajMK94 commented 2 years ago

Thank you for the solution Brian. It worked for me.