ReactVision / viro

ViroReact: The AR and VR library for React Native πŸ“³πŸ’™πŸ’›πŸ€πŸ’š
MIT License
1.3k stars 150 forks source link

How to place an object via ViroARPlaneSelector and place it at the location where user touched the screen? #238

Open Lastik opened 7 months ago

Lastik commented 7 months ago

Requirements:

Please go through this checklist before opening a new issue

Environment

Please provide the following information about your environment:

  1. Development OS: Mac
  2. Device OS & Version: IOS 17
  3. Version: react-viro 2.23.6, React: 18.2.0 ReactNative: 0.71.14
  4. Device(s): Iphone 14

Hello, guys! I wasn't able to properly do a positioning of Viro3DObject based on a onClick coordinates from a ViroARPlane. So have the following questions which might help me. I have the following hierarchy

What coordinates are passed into onClick event? Are they absolute or relative to the plane coordinates? The docs state that the click position are in world coordinates. But I don't think so based on what I see.

I've been trying to implement the following business logic: select the plane and then place an object on a plane at the location of a touch. ViroARPlaneSelector can't do that, it just selects a plane and an object is placed relative to the plane.

My code snippet. snippet.zip