-
Notifications
You must be signed in to change notification settings - Fork 604
Adding an object on vertical plane always rotated. #65
Comments
The Transformation System was designed for horizontal user experiences. We worked closely with our UX designers and researchers to design it in Sceneform 1.0. Our upcoming release will address vertical experiences. In the meantime I might suggest inserting a node to add a rotation. |
@malik-at-work How inserting a node to add a rotation will solve this problem? Can you please elaborate? |
+1 |
When the anchor is created, that anchor includes a rotation where the up direction of the node is along the surface normal of the plane, and also faces roughly towards the user's device. A more detailed description of this is here. After setting parent of the TV node to the anchor, you can change the TV nodes rotation so that it is always facing in the correct direction you want:
@khonakr I believe the question you are asking is slightly different. The axis of rotation for a TransformableNode is always the up direction of the anchor (aka the surface normal of the plane). You may want to do the following:
This way, the TransformableNode is still rotated along the surface normal of the plane, but the rendered object is rotated relative to that. One important note is that the TransformableNode still needs its own collision shape so that the node can be selected and dragged (which by default comes from the Renderable). There is an example here that does something similar that will help show you how to add a child to the TransformableNode and setup the collision shapes correctly. |
@jagsrajput21 did you manage to solve this issue? |
^^ this fixed the issue for me :) Also, thank you @dsternfeld7 for the link describing the coordinate system setup for anchors based on plane type. |
I am adding a TV Model on a vertical plane. TV is always rotated in the y-axis.
It should be parallel to the horizontal plane.
My code for placing TV object on vertical Plane is -
AnchorNode anchorNode = new AnchorNode(hit.createAnchor());
TransformableNode node = new TransformableNode(fragment.getTransformationSystem());
node.setRenderable(renderable);
node.setParent(anchorNode);
fragment.getArSceneView().getScene().addChild(anchorNode);
The text was updated successfully, but these errors were encountered: