A..18 17_NewFunction2.c

17_NewFunction2.c

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



桂田 祐史