-
Notifications
You must be signed in to change notification settings - Fork 604
How to put an object in the air? #185
Comments
Create an anchor from a session and create a world coordinate. For example, the below will spawn a renderable a meter away from the camera. It's debatable, but I think for phone AR, it's much more intuitive to use the camera as a ' gaze pointer' rather than transforming taps into world space.
|
Cannot resolve symbol 'camera' |
@YangShengLiQQ - Can you describe what you are trying to achieve? There are a couple things to consider in your approach. First, since a tap on the screen is in 2D, the Z coordinate of your point needs to be determined. A HitResult contains the point where the ray from the tap meets a 3D object. The second thing to consider is placing an anchor that is not associated with a Trackable object is usually not a good experience. The trackable object (planes, augmented images, oriented points) are update by ARCore to represent the connections between the real world image and the augmented, virtual images. If you place an anchor in the "air", it will drift and move relative to the real world. |
@claywilkinson - Could you tell me how to achieve it with the first one? |
@claywilkinson I'm doing something similar right now, but placing AR based 'cards' to represent POIs in an area that's not attached to any particular plane, but rather created from the session and placed in an arbitrary world space coordinate like what's discussed here: https://developers.google.com/ar/develop/developer-guides/anchors#anchor_one_or_more_objects The tracking is actually pretty good, even if i leave a particular room where I place the objects, go around the office, go into different rooms and go back. There is drift, maybe .5 to 2 meters sometimes, but still, pretty impressive tracking considering it's not attached to any particular physical feature point. So kudos to the arcore/sceneform team for achieving that. |
I created a demo for putting Fukidashi in the air. |
I have used transformable node for load 3D object in the air. But application gonna to be crashed while I have move node and zoom in and zoom out node. Below is code that I have used to load a 3D model in the air.
|
Can you share with us what the crash is? TransformableNode is built for manipulating a node with gesture controls that sits on an ArCore plane. For objects that are floating in mid-air, I suggest just using a regular Node and adding your own UX controls for manipulating it. Also, I suggest creating an AnchorNode that you add the node as a child of of. The AnchorNode uses an ARCore anchor to make sure that the position is tracked correctly in space. |
Closing due to inactivity. |
@dsternfeld7 I have used below code. Using below code 3D model is render fine in the air but while I have to zoom in or zoom out 3D model or move 3D model over the air then application crash.
|
@dsternfeld7 What's wrong in above code? |
@mistrydarshan99 I've tried above code by updating ARCore v1.5.0 and sceneform v1.5.1. And your code is working fine. But the added object in the air keeps moving slightly. I think this is because of that plane detection process. The actions on that added object are working fine like zoom and scale. Is there any way that I can just hover that rendered object over the camera view and whenever the library detects any plane, I can stick that object to that anchor? |
It seems HitResult only gives us intersection with a surface (plane) or a point cloud. How can I get a point in the middle of air with my click, and thus put an object floating in the air?
The text was updated successfully, but these errors were encountered: