sceneview-android
sceneview-android copied to clipboard
How to add dot and make line between two dot in android sceneview
hi everyone, how to i can add dot when tap model and make line between two dot using library link image: https://drive.google.com/file/d/1EefYfMxao-3UqBE1gwILQjq2uAi_SNuR/view?usp=sharing
Hi! The simplest way to display dots and lines is to use spheres and cylinders with unlit materials. You can create them as glTF models and scale appropriately.
hi @grassydragon , i have create renderable, but how to it in library, code: val color = com.google.ar.sceneform.rendering.Color(.8f, 0f, 0f) MaterialFactory.makeOpaqueWithColor(activity, color) .thenAccept { material-> // The sphere is in local coordinate space, so make the center 0,0,0 val sphere = ShapeFactory.makeSphere(0.02f, Vector3.zero(), material) // How to render sphere??? }
Hi! A similar question has been asked on our Discord server and we've found out that the latest version of SceneView doesn't allow rendering shapes without creating a custom node or using a glTF model.
Hi! A similar question has been asked on our Discord server and we've found out that the latest version of SceneView doesn't allow rendering shapes without creating a custom node or using a glTF model.
hi @grassydragon @ThomasGorisse when i tap model, have add dot and line between two dots but the position of measurement points and lines cannot stick to the model. Can u help me resolve it? (i have research but not have way) link video: https://drive.google.com/file/d/1KOuO52MDQY6mVZKl1kn0R3DuRbWWh4Oi/view?usp=sharing
Hi.
Does your model contains sub objects/meshes or is it a single object one? (You can check it within blender)
The SceneView.pickNode function will give you a Renderable that correspond to the picked subpart of your model at export time.
What you actually want to do will be very easy to handle in SceneView 1.0.0 since the ModelNode will directly have child nodes coming from the glTF objects (Renderables, Lights and even Cameras).
So you will just have make each child Node of your ModelNode clickable and add an onTap listener to it.
Hi.
Does your model contains sub objects/meshes or is it a single object one? (You can check it within blender)
The SceneView.pickNode function will give you a
Renderablethat correspond to the picked subpart of your model at export time.What you actually want to do will be very easy to handle in SceneView 1.0.0 since the
ModelNodewill directly have child nodes coming from the glTF objects (Renderables, Lights and even Cameras). So you will just have make each childNodeof yourModelNodeclickable and add anonTaplistener to it.
hi @ThomasGorisse @grassydragon can you for me example onTap in ModelNode and get point at position tap?(gen rendering shape and show it). Please!
hi @ThomasGorisse @grassydragon can you for me example onTap in ModelNode and get point at position tap?(gen rendering shape and show it). Please!
Hi! Yes, as Thomas said you can find the tapped renderable and modify its material, for example. However, to find the point in the 3D scene where the model was tapped you will need to do additional calculations (to unproject the screen point).
Hi.
Does your model contains sub objects/meshes or is it a single object one? (You can check it within blender)
The SceneView.pickNode function will give you a
Renderablethat correspond to the picked subpart of your model at export time.What you actually want to do will be very easy to handle in SceneView 1.0.0 since the
ModelNodewill directly have child nodes coming from the glTF objects (Renderables, Lights and even Cameras). So you will just have make each childNodeof yourModelNodeclickable and add anonTaplistener to it.
Hi, Can you also retreive child nodes from GLB files in SceneView 1.0.0 ? I want to change the node material color onTap.
Hi.
Have a look at https://youtu.be/00vj8AttWO4
Your GLB nodes will be retrieved as children of the ModelNode. You can them retrieve the one you need by id, name,...
You can also, just add an onTap listener to your ModelNode children (only renderable can be touch detected)
hi @ThomasGorisse @grassydragon , version 1.0.0, can i set position for view node? I don't see any function or param to set
hi @ThomasGorisse @grassydragon , version 1.0.0, can i set position for view node? I don't see any function or param to set
Hi!
It should be possible to position a ViewNode since it implements the TransformComponent interface.
hi @ThomasGorisse @grassydragon , version 1.0.0, can i set position for view node? I don't see any function or param to set
Hi! It should be possible to position a
ViewNodesince it implements theTransformComponentinterface.

hi @ThomasGorisse @grassydragon when I using ViewNode -> issues as photo! how I resolve it?
Hi, Thanks for the feedback.
Can you share the part of code you are using for the ViewNode (with its layout please) so we can have a look at where the issue is coming from.
Hi, Thanks for the feedback.
Can you share the part of code you are using for the ViewNode (with its layout please) so we can have a look at where the issue is coming from.
hi @ThomasGorisse @grassydragon layout item_dot.xml
<?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/dots" android:layout_width="8dp" android:layout_height="8dp" android:layout_weight="1" android:background="@drawable/ic_red_dot" android:textColor="#ffffff" android:gravity="center" android:orientation="vertical" android:paddingStart="18dp" android:paddingEnd="18dp" android:paddingTop="12dp" android:paddingBottom="12dp" android:textSize="30dp" android:textStyle="bold" android:text="" android:textAlignment="center" />
drawble ic_red_dot.xml
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval"> <solid android:color="#DB0808"/> </shape>
create viewnode: val view = ViewNode(sceneView, R.layout.item_dot, true, true) sceneView.addChildNode(view)
Hi, Thanks for the feedback.
Can you share the part of code you are using for the ViewNode (with its layout please) so we can have a look at where the issue is coming from.
hi @ThomasGorisse , can you help me resolve it, please
Hi, Thanks for the feedback. Can you share the part of code you are using for the ViewNode (with its layout please) so we can have a look at where the issue is coming from.
hi @ThomasGorisse , can you help me resolve it, please
There is bug in ViewStream Builder

Nice catch @ozh-dev ! I added you the contributor role. You should be able to push directly to the repository. Would you mind creating a PR with your fix? Thanks
Nice catch @ozh-dev ! I added you the contributor role. You should be able to push directly to the repository. Would you mind creating a PR with your fix? Thanks
No problem. I'll do it.
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.