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

Drawing on the 3D Reconstruction #108

Open
TotoLulu94 opened this issue Aug 15, 2018 · 1 comment
Open

Drawing on the 3D Reconstruction #108

TotoLulu94 opened this issue Aug 15, 2018 · 1 comment
Assignees

Comments

@TotoLulu94
Copy link

Hi,

I would like to draw a 3D bounding box in the 3D reconstruction. And I don't really know how to do that.
For now, I have the (x,y,z) world coordinate for each corner of the bouding box. I was thinking about finding the corresponding voxel and assigning them a color. However, I don't really know how to proceed. do you have any Ideas/directions to achieve that ?
Thanks for any reply.

@sgolodetz
Copy link
Collaborator

sgolodetz commented Nov 11, 2018

The voxel reconstruction is rendered by using raycasting to produce an image of the scene and then drawing a quad textured with that image. By default, rendering the quad will then write the depth values for the quad (not the scene) into the depth buffer.

If you instead write the correct depth values for the reconstruction into the depth buffer, you can use e.g. OpenGL to simply draw a bounding box over the top of the reconstruction, with correct depth testing. To fill the depth buffer with the correct depth values, you can render a depth image of the scene (again, using raycasting), and then use e.g. a GLSL shader to write the depth values into the depth buffer. It will take a bit of work to do this (I thought about doing it once but never got round to it), but should work ok.

More simply, if you don't care about depth testing then you can just turn it off and draw the bounding box directly over the reconstruction using OpenGL - that will mean that bits of it that should be occluded by the scene aren't properly occluded, but that may not necessarily be important for your application.

@sgolodetz sgolodetz self-assigned this Nov 11, 2018
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