Skip to content

Commit

Permalink
fixed XNV fov.
Browse files Browse the repository at this point in the history
  • Loading branch information
maxelshepherd committed Jun 19, 2024
1 parent 3919dc7 commit 8ecf174
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 48 deletions.
7 changes: 4 additions & 3 deletions camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ def draw_highlight(self):
self.draw_intersection()

glColor4f(0.0, 1.0, 0.0, 0.2)
# glDisable(GL_DEPTH_TEST) # Enable depth testing
if "XNV" in self.label:
glColor4f(39/255, 168/255, 247/255, 0.2)
self._draw_pyramid()

glColor4f(1.0, 0.0, 0.0, 0.2)
Expand Down Expand Up @@ -163,8 +164,8 @@ def draw(self):
self.draw_intersection()

glColor4f(0.0, 1.0, 0.0, 0.2)
if self.label == "New":
glColor4f(0.0, 0.0, 1.0, 0.2)
if "XNV" in self.label:
glColor4f(39/255, 168/255, 247/255, 0.2)
# glDisable(GL_DEPTH_TEST) # Enable depth testing
self._draw_pyramid()

Expand Down
Binary file modified ground_texture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
160 changes: 115 additions & 45 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def init():
glEnable(GL_DEPTH_TEST) # Enable depth testing



# Main loop
init()
w = 33.95
Expand All @@ -44,119 +45,188 @@ def init():
#plane = Plane(0, -3., 0, w, h)
scene = Scene(display, ground, Rectangle3D(-w*20 / 2, -0.501, -h*20 / 2, w*20, 1, h*20), select)
# Add multiple cameras at different positions

m_height = 4.5

scene.add_camera(
Camera(
position=[12.5, 3.5, 24.4],
fov_width=30.0,
fov_height=20.0,
position=[12.5, m_height, 24.4],
fov_width=26.0,
fov_height=15.0,
ground=ground,
plane=Plane(0, -3., 0, w, h),
plane=Plane(0, -m_height+0.5, 0, w, h),
label="Hikvision",
id=1
)
)
scene.add_camera(
Camera(
position=[12.5, 3.5, 24.4 - 7.5],
fov_width=30.0,
fov_height=20.0,
position=[12.5, m_height, 24.4 - 7.5],
fov_width=26.0,
fov_height=15.0,
ground=ground,
plane=Plane(0, -3., 0, w, h),
plane=Plane(0, -m_height+0.5, 0, w, h),
label="Hikvision",
id=2
)
)
scene.add_camera(
Camera(
position=[12.5, 3.5, 24.4 - 7.5 - 5],
fov_width=30.0,
fov_height=20.0,
position=[12.5, m_height, 24.4 - 7.5 - 5],
fov_width=26.0,
fov_height=15.0,
ground=ground,
plane=Plane(0, -3., 0, w, h),
plane=Plane(0, -m_height+0.5, 0, w, h),
label="Hikvision",
id=3
)
)
scene.add_camera(
Camera(
position=[12.5, 3.5, 24.4 - 7.5 - 5 - 6.5],
fov_width=30.0,
fov_height=20.0,
position=[12.5, m_height, 24.4 - 7.5 - 5 - 6.5],
fov_width=26.0,
fov_height=15.0,
ground=ground,
plane=Plane(0, -3., 0, w, h),
plane=Plane(0, -m_height+0.5, 0, w, h),
label="Hikvision",
id=4
)
)

scene.add_camera(
Camera(
position=[12.5, 3.5, 24.4 - 7.5 - 5 - 6.5 -5],
fov_width=30.0,
fov_height=20.0,
position=[12.5, m_height, 24.4 - 7.5 - 5 - 6.5 -5],
fov_width=26.0,
fov_height=15.0,
ground=ground,
plane=Plane(0, -3., 0, w, h),
plane=Plane(0, -m_height+0.5, 0, w, h),
label="Hikvision",
id=5
)
)

# Horizontal coverage at m_height : 5.509 meters
# Vertical coverage at 3.5 : 4.116 meters

# scene.add_camera(
# Camera(
# position=[12.5-10, 3.5, 24.4],
# fov_width=35.0,
# fov_height=20.0,
# ground=ground,
# plane=Plane(0, -m_height+0.5, 0, w, h),
# label="QNV-C8083R",
# id=6
# )
# )
#
# scene.add_camera(
# Camera(
# position=[12.5-10, 3.5, 24.4 -6],
# fov_width=35.0,
# fov_height=20.0,
# ground=ground,
# plane=Plane(0, -m_height+0.5, 0, w, h),
# label="QNV-C8083R",
# id=6
# )
# )
#
# scene.add_camera(
# Camera(
# position=[12.5-10, 3.5, 24.4 -6*2],
# fov_width=35.0,
# fov_height=20.0,
# ground=ground,
# plane=Plane(0, -m_height+0.5, 0, w, h),
# label="QNV-C8083R",
# id=7
# )
# )
#
# scene.add_camera(
# Camera(
# position=[12.5-10, 3.5, 24.4-6*3],
# fov_width=35.0,
# fov_height=20.0,
# ground=ground,
# plane=Plane(0, -m_height+0.5, 0, w, h),
# label="QNV-C8083R",
# id=8
# )
# )
#
# scene.add_camera(
# Camera(
# position=[12.5-10, 3.5, 24.4-6*4],
# fov_width=35.0,
# fov_height=20.0,
# ground=ground,
# plane=Plane(0, -m_height+0.5, 0, w, h),
# label="QNV-C8083R",
# id=9
# )
# )

# Horizontal coverage at 3.5 : 7.0 meters
# Vertical coverage at 3.5 : 4.592 meters

scene.add_camera(
Camera(
position=[12.5-10, 3.5, 24.4],
fov_width=35.0,
fov_height=20.0,
position=[12.5-10, m_height, 24.4],
fov_width=25.0,
fov_height=15.0,
ground=ground,
plane=Plane(0, -3., 0, w, h),
label="New",
plane=Plane(0, -m_height+0.5, 0, w, h),
label="XNV-C7083R",
id=6
)
)

scene.add_camera(
Camera(
position=[12.5-10, 3.5, 24.4 -6],
fov_width=35.0,
fov_height=20.0,
position=[12.5-10, m_height, 24.4 -6],
fov_width=25.0,
fov_height=15.0,
ground=ground,
plane=Plane(0, -3., 0, w, h),
label="New",
plane=Plane(0, -m_height+0.5, 0, w, h),
label="XNV-C7083R",
id=6
)
)

scene.add_camera(
Camera(
position=[12.5-10, 3.5, 24.4 -6*2],
fov_width=35.0,
fov_height=20.0,
position=[12.5-10, m_height, 24.4 -6*2],
fov_width=25.0,
fov_height=15.0,
ground=ground,
plane=Plane(0, -3., 0, w, h),
label="New",
plane=Plane(0, -m_height+0.5, 0, w, h),
label="XNV-C7083R",
id=7
)
)

scene.add_camera(
Camera(
position=[12.5-10, 3.5, 24.4-6*3],
fov_width=35.0,
fov_height=20.0,
position=[12.5-10, m_height, 24.4-6*3],
fov_width=25.0,
fov_height=15.0,
ground=ground,
plane=Plane(0, -3., 0, w, h),
label="New",
plane=Plane(0, -m_height+0.5, 0, w, h),
label="XNV-C7083R",
id=8
)
)

scene.add_camera(
Camera(
position=[12.5-10, 3.5, 24.4-6*4],
fov_width=35.0,
fov_height=20.0,
position=[12.5-10, m_height, 24.4-6*4],
fov_width=25.0,
fov_height=15.0,
ground=ground,
plane=Plane(0, -3., 0, w, h),
label="New",
plane=Plane(0, -m_height+0.5, 0, w, h),
label="XNV-C7083R",
id=9
)
)
Expand Down

0 comments on commit 8ecf174

Please sign in to comment.