Reduce light demo loop time Added rotating plot3d with light demo 43/12643/2
Pedro Arthur [Sun, 22 Sep 2013 19:49:16 +0000 (16:49 -0300)]
Change-Id: I31a4601a53543e0847ad0018e88ed3e9b8975386

scilab/modules/graphics/demos/lighting/lighting.dem.gateway.sce
scilab/modules/graphics/demos/lighting/rot_light.dem.sce
scilab/modules/graphics/demos/lighting/rot_plot3d.dem.sce [new file with mode: 0644]

index 56cf4c1..4f722db 100644 (file)
@@ -8,6 +8,7 @@ demopath = get_absolute_file_path("lighting.dem.gateway.sce");
 subdemolist = [                                   ..
 "Simple light"      , "simple_light.dem.sce"    ; ..
 "Rotating light"    , "rot_light.dem.sce"       ; ..
+"Rotating plot3d"    , "rot_plot3d.dem.sce"       ; ..
 "Colored light"     , "color_light.dem.sce"     ; ..
 "Directional light" , "dir_light.dem.sce"       ];
 
index 2ca3304..e986823 100644 (file)
@@ -6,16 +6,17 @@
 
 function demo_rot_light()
 
-    my_handle             = scf(100001);
+    my_handle = scf(100001);
     clf(my_handle,"reset");
     demo_viewCode("rot_light.dem.sce");
 
     // DEMO START
-
     my_plot_desc          = "Rotating light";
     my_handle.figure_name = my_plot_desc;
 
-    plot3d;l=light();s=gce();
+    plot3d;
+    l=light();
+    s=gce();
 
     for i=0:2000
         sleep(5);
@@ -24,9 +25,7 @@ function demo_rot_light()
         z = 2;
         l.position = [x y z];
     end
-
     // DEMO END
-
 endfunction
 
 
diff --git a/scilab/modules/graphics/demos/lighting/rot_plot3d.dem.sce b/scilab/modules/graphics/demos/lighting/rot_plot3d.dem.sce
new file mode 100644 (file)
index 0000000..8e6bf25
--- /dev/null
@@ -0,0 +1,32 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Pedro SOUZA
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+
+function demo_rot_light()
+
+    my_handle = scf(100001);
+    clf(my_handle, "reset");
+    demo_viewCode("rot_plot3d.dem.sce");
+
+    // DEMO START
+    my_plot_desc = "Rotating light";
+    my_handle.figure_name = my_plot_desc;
+
+    plot3d;
+    l=light();
+    s=gce();
+    a=gca();
+
+    for i=1:360
+        sleep(5);
+        a.rotation_angles = [70 i];
+    end
+    // DEMO END
+endfunction
+
+
+demo_rot_light();
+clear demo_rot_light;
+