MCPcopy Create free account
hub / github.com/brenocq/implot3d / DemoBoxScale

Function DemoBoxScale

implot3d_demo.cpp:1140–1159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1138//-----------------------------------------------------------------------------
1139
1140void DemoBoxScale() {
1141 IMGUI_DEMO_MARKER("Axes/Box Scale");
1142 constexpr int N = 100;
1143 float xs[N], ys[N], zs[N];
1144 for (int i = 0; i < N; i++) {
1145 float t = i / (float)(N - 1);
1146 xs[i] = sinf(t * 2.0f * IM_PI);
1147 ys[i] = cosf(t * 4.0f * IM_PI);
1148 zs[i] = t * 2.0f - 1.0f;
1149 }
1150
1151 static float scale[3] = {1.0f, 1.0f, 1.0f};
1152 ImGui::SliderFloat3("Box Scale", scale, 0.1f, 2.0f, "%.2f");
1153
1154 if (ImPlot3D::BeginPlot("##BoxScale")) {
1155 ImPlot3D::SetupBoxScale(scale[0], scale[1], scale[2]);
1156 ImPlot3D::PlotLine("3D Curve", xs, ys, zs, N);
1157 ImPlot3D::EndPlot();
1158 }
1159}
1160
1161void DemoBoxRotation() {
1162 IMGUI_DEMO_MARKER("Axes/Box Rotation");

Callers

nothing calls this directly

Calls 4

BeginPlotFunction · 0.85
SetupBoxScaleFunction · 0.85
PlotLineFunction · 0.85
EndPlotFunction · 0.85

Tested by

no test coverage detected