A..14 13_g_vision.c

13_g_vision.c

   1 #include<stdio.h>
   2 #include<glsc3d_3.h>
   3 #define WX     (600)
   4 #define WY     (600)
   5 int main()
   6 {
   7     g_init("Window", WX, WY);
   8     g_def_scale_3D_fix(0,
   9                        -1, 1,
  10                        -1, 1,
  11                        -1, 1,
  12                        20.0, 20.0,
  13                        WX - 40.0, WY - 40.0);
  14 
  15     for (int i_time = 0;; i_time++)
  16     {
  17         double a = -1;
  18         g_vision(0,
  19                  0, a, 4,
  20                  0, 0, 1,
  21                  1.0);
  22         g_cls();
  23         g_sel_scale(0);
  24         g_boundary();
  25         g_box_3D(-1, 1, -1, 1, -1, 1, 1, 0);
  26         //X-Axes
  27         g_area_color(1, 0, 0, 1);
  28         g_arrow_3D(-1, -1, -1,
  29                    1.0, 0.0, 0.0,
  30                    2.0, 0.25,
  31                    0, 1);
  32         //Y-Axes
  33         g_area_color(0, 1, 0, 1);
  34         g_arrow_3D(-1, -1, -1,
  35                    0.0, 1.0, 0.0,
  36                    2.0, 0.25,
  37                    0, 1);
  38         //Z-Axes
  39         g_area_color(0, 0, 1, 1);
  40         g_arrow_3D(-1, -1, -1,
  41                    0.0, 0.0, 1.0,
  42                    2.0, 0.25,
  43                    0, 1);
  44 
  45         g_area_color(1, 1, 0, 1);
  46         g_cone_3D(0, 0, -1,
  47                   0, 0, 1,
  48                   0.5, 2,
  49                   0, 1);
  50         g_finish();
  51     }
  52     return 0;
  53 }



桂田 祐史