Skip to content

Commit

Permalink
Displaying camera focus range
Browse files Browse the repository at this point in the history
  • Loading branch information
fszewczyk committed Mar 21, 2023
1 parent 9dcc1ec commit 51eb6e5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/ui/plot/plotViewTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,18 @@ cameraSettings plotViewTab::plotCamera() {

settingsCamera.origin = getPointFromPlane(settingsCamera.origin, x, y);

static float focusX[361];
static float focusY[361];
for (double deg = 0; deg <= 360; ++deg) {
double angle = deg * 2 * PI / 360;
focusX[static_cast<int>(deg)] = cosf(angle) * settingsCamera.focusDistance + x;
focusY[static_cast<int>(deg)] = sinf(angle) * settingsCamera.focusDistance + y;
}

ImPlot::SetNextMarkerStyle(ImPlotMarker_None);
ImPlot::SetNextLineStyle(ImVec4(0.3, 0.3, 0.3, settingsCamera.depthOfField), 2);
ImPlot::PlotLine("Camera Focus", focusX, focusY, 361);

return settingsCamera;
}

Expand Down

0 comments on commit 51eb6e5

Please sign in to comment.