PTCInc / vuforia-engine

Bug and feedback issue tracker for the Vuforia Engine SDK
https://developer.vuforia.com
19 stars 0 forks source link

[Question] How to find coordinates of various components of an AreaTarget #96

Closed thechargedneutron closed 3 months ago

thechargedneutron commented 4 months ago

Summarize your feature feedback Hi, thanks for the clear documentation on capturing area target. I am able to create an area target and place items inside it. However, when placing the 3D objects like cube, I have to manually zoom in to see the 3D cube is touching the floor and often times it's not exactly aligned to the walls or floors. Is there a way to see the local coordinates of various items in the scene, like table-top, walls, floor etc?

I understand that the area target scan is being converted to an object that have triangles, is it possible to get their local coordinates so that we can easily put objects without worrying if they are floating in the air and not touching the surface properly.

Describe your feature Provided above.

Use-case description Provided above.

Business impact This feature seems important when the scene is large and we want to place many items.

Workaround Manually look at the scene elements and place 3D objects.

Thanks in advance.

ptc-pscheper commented 4 months ago

Are you looking for a way to place 3D objects into your Area Target within the Unity Editor and having them automatically snapped to your geometry?

thechargedneutron commented 4 months ago

Basically, I am looking to make sure I know the coordinates of walls and floors so I can add 3D objects using the C# code instead of adjusting the x, y, z axis manually through the Unity Editor.

Right now, I am following the following steps:

  1. I import a 3D object and then manually look at the objects from all sides to make sure it touches the floor/wall (which is prone to errors)
  2. Then I note down the (x, y, z) and rotation to understand how the coordinate system of the area target is oriented.
  3. I use the (x, y, z) and the rotation to place newer objects using the C# code.

My question is: is there a better way of achieving this? I want to put a lot of 3D objects in the scene so it may not be possible to keep doing this for all 3D objects in all the planes.

ptc-pscheper commented 4 months ago

Is there a possibility for you to use the Raycast functionality together with the collision mesh to determine the position of the floor/wall?

thechargedneutron commented 4 months ago

That sounds reasonable, I will check the docs for Raycast and check if that works in the environment that I captured. But is there a way the captured area target has that information?

ptc-pscheper commented 4 months ago

No, I don't believe so. If you are only working in the Unity Editor there's a possibility to create custom gizmos to show the local position /rotation of the objects to more easy write down the values.

thechargedneutron commented 3 months ago

Thanks, I will try one of the two mentioned choices. Thanks for the prompt replies.