Skip to content

Commit

Permalink
camera path rendering bugfixes
Browse files Browse the repository at this point in the history
Cherry picked from Splat_VINS
From 714e66dc9e0838e9eafe4148738a5ec81a19c7ed Mon Sep 17 00:00:00 2001
  • Loading branch information
hyperlogic committed May 11, 2024
1 parent d985c9f commit 5e9207c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/camerapathrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ void CameraPathRenderer::BuildPathVao(const std::vector<Camera>& cameraVec)
// build lines for each path segment
if (cameraVec.size() > 1)
{
const Camera* prev = &cameraVec[cameraVec.size() - 1];
const Camera* prev = &cameraVec[0];
for (size_t i = 1; i < cameraVec.size(); i++)
{
const Camera* curr = cameraVec.data() + i;
Expand All @@ -178,6 +178,13 @@ void CameraPathRenderer::BuildPathVao(const std::vector<Camera>& cameraVec)
prev = curr;
}
}
else
{
posVec.push_back(glm::vec3(0.0f, 0.0f, 0.0f));
posVec.push_back(glm::vec3(0.0f, 0.0f, 0.0f));
colVec.push_back(PATH_COLOR);
colVec.push_back(PATH_COLOR);
}

auto posBuffer = std::make_shared<BufferObject>(GL_ARRAY_BUFFER, posVec);
auto colBuffer = std::make_shared<BufferObject>(GL_ARRAY_BUFFER, colVec);
Expand Down

0 comments on commit 5e9207c

Please sign in to comment.