| 17 | // ---------------------------------------------------------------------------------------- |
| 18 | |
| 19 | int main() |
| 20 | { |
| 21 | // Let's make a point cloud that looks like a 3D spiral. |
| 22 | std::vector<perspective_window::overlay_dot> points; |
| 23 | dlib::rand rnd; |
| 24 | for (double i = 0; i < 20; i+=0.001) |
| 25 | { |
| 26 | // Get a point on a spiral |
| 27 | dlib::vector<double> val(sin(i),cos(i),i/4); |
| 28 | |
| 29 | // Now add some random noise to it |
| 30 | dlib::vector<double> temp(rnd.get_random_gaussian(), |
| 31 | rnd.get_random_gaussian(), |
| 32 | rnd.get_random_gaussian()); |
| 33 | val += temp/20; |
| 34 | |
| 35 | // Pick a color based on how far we are along the spiral |
| 36 | rgb_pixel color = colormap_jet(i,0,20); |
| 37 | |
| 38 | // And add the point to the list of points we will display |
| 39 | points.push_back(perspective_window::overlay_dot(val, color)); |
| 40 | } |
| 41 | |
| 42 | // Now finally display the point cloud. |
| 43 | perspective_window win; |
| 44 | win.set_title("perspective_window 3D point cloud"); |
| 45 | win.add_overlay(points); |
| 46 | win.wait_until_closed(); |
| 47 | } |
| 48 | |
| 49 | // ---------------------------------------------------------------------------- |
| 50 |
nothing calls this directly
no test coverage detected