| 141 | } |
| 142 | |
| 143 | void DemoScatterPlots() { |
| 144 | IMGUI_DEMO_MARKER("Plots/Scatter Plots"); |
| 145 | srand(0); |
| 146 | static float xs1[100], ys1[100], zs1[100]; |
| 147 | for (int i = 0; i < 100; i++) { |
| 148 | xs1[i] = i * 0.01f; |
| 149 | ys1[i] = xs1[i] + 0.1f * ((float)rand() / (float)RAND_MAX); |
| 150 | zs1[i] = xs1[i] + 0.1f * ((float)rand() / (float)RAND_MAX); |
| 151 | } |
| 152 | static float xs2[50], ys2[50], zs2[50]; |
| 153 | for (int i = 0; i < 50; i++) { |
| 154 | xs2[i] = 0.25f + 0.2f * ((float)rand() / (float)RAND_MAX); |
| 155 | ys2[i] = 0.50f + 0.2f * ((float)rand() / (float)RAND_MAX); |
| 156 | zs2[i] = 0.75f + 0.2f * ((float)rand() / (float)RAND_MAX); |
| 157 | } |
| 158 | |
| 159 | if (ImPlot3D::BeginPlot("Scatter Plots")) { |
| 160 | ImPlot3D::PlotScatter("Data 1", xs1, ys1, zs1, 100); |
| 161 | ImPlot3DSpec spec; |
| 162 | spec.Marker = ImPlot3DMarker_Square; |
| 163 | spec.MarkerSize = 6; |
| 164 | spec.MarkerLineColor = ImPlot3D::GetColormapColor(1); |
| 165 | spec.MarkerFillColor = ImPlot3D::GetColormapColor(1); |
| 166 | spec.FillAlpha = 0.25f; |
| 167 | ImPlot3D::PlotScatter("Data 2", xs2, ys2, zs2, 50, spec); |
| 168 | ImPlot3D::EndPlot(); |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | void DemoTrianglePlots() { |
| 173 | IMGUI_DEMO_MARKER("Plots/Triangle Plots"); |
nothing calls this directly
no test coverage detected