Question: Only one light source allowed

I tried to use multiple light sources with transparency for 3D plots and could not get it to work.  There are indications in the plot,structure help that this is supposed to be possible.  I have attached a worksheet that demonstrates some of the problems with the "light" and "LIGHT" options for 3D plotting.  Much of the output has been removed since the graphics take so much space.  The same plots are generated in both Windows and Linux.

Does anyone know if having multiple light sources is supposed to work?  If it is, have I done something wrong?

 

 

restart;
with(plots):
with(plottools):

 

The first plot is an animation that should change the light color on a sphere from blue to red.  The last light source is the only source used.

 

Plist1 := [seq(display(sphere([0,0,0],1,color=white),light=[45,45,i/10,0,(10-i)/10]),i=0..10)]:
display(Plist1,insequence=true);

 

The next plots show the actual plots in the sequence of plots demonstrating how the color changes.

 

for i from 1 to 11 do
      Plist1[i];
     end do;

 

The next 2 plots show how only the last light source in a plot command is actually used.

display(sphere([0,0,0],1,color=white),light=[45,245,0,0,1],light=[45,45,1,0,0]);

 

display(sphere([0,0,0],1,color=white),light=[45,45,1,0,0],light=[45,305,0,0,1]);

 

 

The next plots are an original plot from the plot,structure  help page and the same plot with two light

source removed.  They appear to be the same plot.

PLOT3D(POLYGONS([[0,0,0],[1,0,0],[1,1,0],[0,1,0]],
                [[0,0,0],[0,1,0],[0,1,1],[0,0,1]],
                [[1,0,0],[1,1,0],[1,1,1],[1,0,1]],
                [[0,0,0],[1,0,0],[1,0,1],[0,0,1]],
                [[0,1,0],[1,1,0],[1,1,1],[0,1,1]],
                [[0,0,1],[1,0,1],[1,1,1],[0,1,1]]),
       LIGHT(0,0,0.0,0.7,0.0), LIGHT(100,45,0.7,0.0,0.0),
       LIGHT(100,-45,0.0,0.0,0.7), AMBIENTLIGHT(0.4,0.4,0.4),
       TITLE(CUBE), STYLE(PATCH), COLOR(ZHUE));

 

PLOT3D(POLYGONS([[0,0,0],[1,0,0],[1,1,0],[0,1,0]],
                [[0,0,0],[0,1,0],[0,1,1],[0,0,1]],
                [[1,0,0],[1,1,0],[1,1,1],[1,0,1]],
                [[0,0,0],[1,0,0],[1,0,1],[0,0,1]],
                [[0,1,0],[1,1,0],[1,1,1],[0,1,1]],
                [[0,0,1],[1,0,1],[1,1,1],[0,1,1]]),
       LIGHT(100,-45,0.0,0.0,0.7), AMBIENTLIGHT(0.4,0.4,0.4),
       TITLE(CUBE), STYLE(PATCH), COLOR(ZHUE));

 

 

 

Download LightSourceTests.mw

Please Wait...