Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Measurement from point cloud #24

Open
TuomasK1989 opened this issue Jun 8, 2020 · 7 comments
Open

Measurement from point cloud #24

TuomasK1989 opened this issue Jun 8, 2020 · 7 comments

Comments

@TuomasK1989
Copy link

What would be the easiest and most accurate way of taking measurement (point xyz coordinates) from this point cloud rendering system? I guess raycasting is not working.

@SFraissTU
Copy link
Owner

Hi. I'm not sure if I understand your question. What do you mean by "taking measurement"? I imagine you might mean selecting a point by clicking.
In that case, my framework does not provide a way to do this. If you want to implement this yourself, you can iterate over the octree nodes and check which ones intersect the ray through the selected pixel. There is also a fancy GPU-based way to do this. Checkout chapter 5.3.1 of Markus Schütz's Potree-Master-Thesis for more info: https://publik.tuwien.ac.at/files/publik_252607.pdf (however I'm not sure how hard or easy it would be to implement this in Unity).

@TuomasK1989
Copy link
Author

Hi, Thanks for the hints. that is exactly what I meant. What do You think that could this be on the development roadmap as I am a novice when it comes to coding this stuff? In my opinion this is a must feature that users can pick points and measure distances from surveyed point clouds.

@TuomasK1989
Copy link
Author

I have now managed to get the node/gameobjects names that are intersecting ray. Now would need to get the point data that is inside each octree node. Can I somehow list all points that are inside a node using nodes name? Also I would like to use only rendered points so is this possible to do without reloading data into memory?

@SFraissTU
Copy link
Owner

SFraissTU commented Jun 23, 2020

Hi!
Here are some hints that might be useful for you:

  • If you have a Node-object, its points should be accessible via the property VerticesToStore. The coordinates of the points in this array are relative to the origin of the bounding box of the node.
  • If a node is rendered, all of its points are rendered.
  • If you want to know whether a node is rendered, V2TraversalThread has an attribute "visibleNodes", which is a set of all the nodes that are currently being displayed (just take care about synchronization, as this is constantly updated).

@TuomasK1989
Copy link
Author

Hi,

@SFraissTU Thanks for having time to answer to my question. At the moment I only have gameobjects and their names and I am trying to find a way how to access Node-object and the VerticesToStore. Can I somehow get Node-object with the gameobjects name?

@SFraissTU
Copy link
Owner

Hi!
Sorry for my late response. Yes that should be possible. The game object name has the syntax "[pointcloudname]/r[nodeaddress] ([#points])"
In V2Renderer there is the attribute rootNodes. The root node of each point cloud is in there. You can iterate over the root nodes and check if node.metadata.cloudName is equal to [pointcloudname] to find the right root node.
Once you have the right root node, you can find the right child using the digits of the address. If the address is empty, then the root node is the desired node. Otherwise, you can get there through the children. For example if the nodeaddress is "2431", then that node is rootNode.getChild(2).getChild(4).getChild(3).getChild(1).

@TuomasK1989
Copy link
Author

Hi, I managed to get this work relatively fine. I added reference pointer to the node itself during the gameobject creation so that every gameobject has corresponding node component in it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants