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

Want example/some way to get eight vertices of each child in octree data structure implemented using open3D. #4688

Closed
shashankIITK opened this issue Feb 2, 2022 · 5 comments

Comments

@shashankIITK
Copy link

I want to implement frustum culling using octree for my project on pointcloud. For this I need eight vertices of each child node (bounding volume) in octree implemented on 3D data. I have gone through functionalities of octree in documentation but could not found any function which can give me such eight vertices of each cube in which we go on dividing space in octree. Kindly help me if this is possible with ope3D with example.

@theNded
Copy link
Contributor

theNded commented Feb 2, 2022

You can refer to this example. The bounding box can be easily computed given the known octree voxel size and node origin and depth.

@theNded theNded closed this as completed Feb 2, 2022
@shashankIITK
Copy link
Author

Can you please tell what does node origin refers to here? It is not clear from documentation.
Also how to get voxel size (for every child or for entire bounding box of whole scene for that matter) ?

@theNded
Copy link
Contributor

theNded commented Feb 2, 2022

You may refer to how Open3D renders an Octree: https://github.com/isl-org/Open3D/blob/master/cpp/open3d/visualization/shader/SimpleShader.cpp#L744-L754

Here, node_info->origin_ locates a node, cuboid_vertex_offsets generates all 8 vertices, and node_info->size_ gives the voxel size.

@shashankIITK
Copy link
Author

I am working with python. Can you share some method using which I could get all 8 vertices of each children of octree? and I couldn't get what is origin by the link you have shared. Please help me.

@theNded
Copy link
Contributor

theNded commented Feb 2, 2022

I already gave you a python example and an explanation of how to generate vertices.
Origin apparently is the origin point that you put (0,0,0) at a voxel. Please study the basics of octrees and figure out the rest.

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