diff --git a/camera.py b/camera.py index 11befac..9010829 100644 --- a/camera.py +++ b/camera.py @@ -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) @@ -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() diff --git a/ground_texture.png b/ground_texture.png index c1dc5c7..f7b59a3 100644 Binary files a/ground_texture.png and b/ground_texture.png differ diff --git a/main.py b/main.py index 556ad3a..372a556 100644 --- a/main.py +++ b/main.py @@ -36,6 +36,7 @@ def init(): glEnable(GL_DEPTH_TEST) # Enable depth testing + # Main loop init() w = 33.95 @@ -44,46 +45,49 @@ 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 ) @@ -91,72 +95,138 @@ def init(): 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 ) )