-
Notifications
You must be signed in to change notification settings - Fork 195
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
feat(potree): render all nodes #3162
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. Fine to land.
Suggested a bunch of generalizations, they could come as a separate PR.
@@ -17,8 +17,8 @@ | |||
"@deck.gl/layers": "^9.0.32", | |||
"@deck.gl/mesh-layers": "^9.0.32", | |||
"@deck.gl/react": "^9.0.32", | |||
"@loaders.gl/potree": "4.4.0-alpha.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion:
- I'd probably rename this example from
potree
topoint-tile-source
with the goal of expanding it to cover COPCSource. - And perhaps we can even make point tile sources for 3D tiles and I3S?
@@ -1,5 +1,7 @@ | |||
import {Vector3} from '@math.gl/core'; | |||
import {DataSource} from '@loaders.gl/loader-utils'; | |||
import {POTreeNode} from '@loaders.gl/potree'; | |||
import {PotreeTraverser} from './potree-traverser'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- This idea of having a special traverser for each format always seemed wrong to me - i.e. I was hoping that we would not need to copy this particular pattern from the current
TIleset3D
code - The source should normalize the returned data so that a common traverser can handle the data.
@@ -45,7 +58,7 @@ export class PointcloudTileset { | |||
} | |||
|
|||
get tiles() { | |||
return []; | |||
return this._selectedNodes; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I would prefer that we don't overuse getters. There should be a good reason for using a getter. I.e.
- Why use a getter here?
- Why not just have a method
getTiles()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tileset.tiles
is used by deck.gl
@@ -76,4 +76,54 @@ export class PotreeTile3DLayer< | |||
} | |||
}); | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to rename this file/class to point-tile-source-layer
?
@@ -0,0 +1,37 @@ | |||
import {POTreeNode} from "@loaders.gl/potree"; | |||
|
|||
export class PotreeTraverser { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we must have a traverser class, can we generalize it a little bit: PointTileSourceTraverser
?
|
||
if (result) { | ||
let projection; | ||
if (this.metadata?.projection) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend defining helper methods for reprojection and bounding box calculations.
@alekzvik This allows small point clouds to be rendered in an example (loads and renders all tiles). Should provide a better starting point for integrating |
No description provided.