https://github.com/probcomp/depthrenderer
Minimal OpenGL-based 3D depth renderer in Julia
https://github.com/probcomp/depthrenderer
Last synced: about 2 months ago
JSON representation
Minimal OpenGL-based 3D depth renderer in Julia
- Host: GitHub
- URL: https://github.com/probcomp/depthrenderer
- Owner: probcomp
- License: apache-2.0
- Created: 2019-05-17T03:09:19.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2021-04-29T16:52:27.000Z (almost 5 years ago)
- Last Synced: 2025-07-31T07:59:41.486Z (8 months ago)
- Language: Julia
- Homepage:
- Size: 79.4 MB
- Stars: 1
- Watchers: 6
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DepthRenderer
Simple OpenGL-based depth renderer.
Depends on the [Geometry](https://github.com/probcomp/Geometry) package.
For a scene with three triangles, with x,y,z coordinates:
Triangle 1 (1 unit from camera)
```
a = [-0.25, -0.25, -1]
b = [0.25, -0.25, -1]
c = [0.0, 0.25, -1]
```
Triangle 2 (2 units from camera)
```
a = [-1, -1, -2]
b = [1, -1, -2]
c = [0, 1, -2]
```
Triangle 3 (4 units from camera)
```
a = [1.5, 2, -4]
b = [2, 2, -4]
c = [2, 1.5, -4]
```
and with the far plane (`far`) set to 5 units, and `fx=width`, and `fy=height`, the depth image returned by `get_depth_image!` has the following format:
```
depth_image[row,col] is in distance units, with values:
row=1 row=width
^
| 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4 4 col=height
| 5 5 5 5 5 5 5 5 5 2 2 5 5 5 5 5 5 5 5 4
| 5 5 5 5 5 5 5 5 5 2 2 5 5 5 5 5 5 5 5 5
| 5 5 5 5 5 5 5 5 2 2 2 2 5 5 5 5 5 5 5 5
| 5 5 5 5 5 5 5 5 2 2 2 2 5 5 5 5 5 5 5 5
| 5 5 5 5 5 5 5 2 2 2 2 2 2 5 5 5 5 5 5 5
| 5 5 5 5 5 5 5 2 2 1 1 2 2 5 5 5 5 5 5 5
| 5 5 5 5 5 5 2 2 2 1 1 2 2 2 5 5 5 5 5 5
Y 5 5 5 5 5 5 2 2 1 1 1 1 2 2 5 5 5 5 5 5
| 5 5 5 5 5 2 2 2 1 1 1 1 2 2 2 5 5 5 5 5
| 5 5 5 5 5 2 2 1 1 1 1 1 1 2 2 5 5 5 5 5
| 5 5 5 5 2 2 2 1 1 1 1 1 1 2 2 2 5 5 5 5
| 5 5 5 5 2 2 1 1 1 1 1 1 1 1 2 2 5 5 5 5
| 5 5 5 2 2 2 1 1 1 1 1 1 1 1 2 2 2 5 5 5
| 5 5 5 2 2 1 1 1 1 1 1 1 1 1 1 2 2 5 5 5
| 5 5 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 5 5
| 5 5 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 5 5
| 5 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 5
| 5 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 5
| 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 col=1
|
*----------------X------------------------->
NOTE Z-axis is point towards camera (objects in front of camera have negative Z-coordinate)
```