sceneform-android-sdk icon indicating copy to clipboard operation
sceneform-android-sdk copied to clipboard

Show debugging points

Open izdi opened this issue 8 years ago • 12 comments

In ARCore sample there are points in the view, how to enable this in Sceneform sample?

I would also like to know how to disable "moving hand".

Thank you.

izdi avatar Jul 01 '18 20:07 izdi

For your second question, see #68 . As for the first, I'm also curious about it. I think you can get the known points with this :

PointCloud pC = arFragment.getArSceneView().getArFrame().acquirePointCloud();
FloatBuffer points = pC.getPoints();

But I don't know if there is a simple way to show them other than creating a renderable for each.

dyavil avatar Jul 02 '18 07:07 dyavil

ARKit has this option on configuration level of session.

Visually it's easier for me to understand that trackable points exist in the area I taped.

izdi avatar Jul 02 '18 10:07 izdi

I wrote a PointCloudNode class to primatively display the point cloud. It's currently on my personal fork (I am working to get it checked in here), but feel free to use it or simply look at it for inspiration.

claywilkinson avatar Jul 03 '18 17:07 claywilkinson

I would also like to have the point cloud rendering this as a debug option. It is a good indicator of how good the tracking is working.

DennisBauer avatar Jul 04 '18 13:07 DennisBauer

@claywilkinson did you find a workaround to display points that are always facing the camera? Since points are attached to a Node, the drawing takes into account the initial node's rotation, and therefore when you move the camera, they no longer face the camera (and can become invisible when rotation becomes 90°). Also, points are drawn as triangles but shoulsn't they be squares? (or even cubes to avoid the rotation issue?)

SimonMarquis avatar Jul 05 '18 10:07 SimonMarquis

Hi @SimonMarquis - The geometry for the point cloud is updated on every frame (since the point cloud is updated every frame too). The points are in world space coordinates, so adding them to a unrotated node in the scene positions them correctly for the current camera pose.

Are you seeing the points disappearing but still in the cloud, or are they removed from the point cloud data?

I am using triangles to keep it simple, feel free to copy the code and customize it. I'd love to see what you come up with.

claywilkinson avatar Jul 07 '18 00:07 claywilkinson

Are you seeing the points disappearing but still in the cloud, or are they removed from the point cloud data?

I was hoping to find a way to keep them visible whatever the camera pose.

I am using triangles to keep it simple, feel free to copy the code and customize it.

Then why are you using 4 points in your draw commands? Triangles should only require 3 points (or am I missing something here?)

https://github.com/claywilkinson/arcore-android-sdk/blob/d13b1b7c905d162519920e980cf3c0fba59f948a/samples/cloud_anchor_java/app/src/main/java/com/google/ar/core/examples/java/cloudanchor/sceneform/PointCloudNode.java#L102-L116

SimonMarquis avatar Jul 09 '18 08:07 SimonMarquis

@SimonMarquis - I changed the rendering to be pyramids, so they are visible from all angles. Thanks for pointing out that my code was incomplete! PointCloudNode.java.

claywilkinson avatar Jul 11 '18 21:07 claywilkinson

👍 for the pyramids choice. Unfortunately, they still appear as flat (2D) triangles when I change the camera orientation. Did I miss something to enable or configure on the AR rendering side?

SimonMarquis avatar Jul 13 '18 15:07 SimonMarquis

Sorry about that - I had some of the points backwards. Now it works: pointcloud

PointCloud.java

claywilkinson avatar Jul 13 '18 17:07 claywilkinson

Closing due to inactivity. A feature request for PointCloudRenderer is tracked at https://github.com/google-ar/sceneform-android-sdk/issues/207

malik-at-work avatar Jul 25 '18 17:07 malik-at-work

I've finally created my own PointCloud renderer, based on ShapeFactory.makeCube() code. It renders small 3D cubes on each feature point.

output

SimonMarquis avatar Sep 10 '19 16:09 SimonMarquis