Question: Foreground and background do not change when the figure is rotated

Hi, 

I represent 3 thin parallel slices of colors red, green and blue; all have the same transparency equal to 0.5
For the default orientation of the display, the blue slice is on the forefront, the red one in the background and the green one in beween. Then the blue slice is "bluer" than green and  the green one "greener" than red (FIG 1)
If you rotate manually the figure in order to place the red slice in the forefront and the blue one in the background, you expect to have the red slice "redder" than the green one and the green one "greener" than the blue one (FIG 2)
This is not the case.

The order in which the slices appear in the PLOT3D command defines the foreground and the background, but these latter are not dynamically recalculated when the figure is rotated.
To recover the correct colors one must revert the order of the slices in PLOT3D (FIG 3)

Are we comdamned to change to change manually the order of the slices in PLOT3D or does it exist an option whixh avoids doing so?

Don't pay too much attention to the plots above for the foreground is strangely correct on figure 2 ???

restart

with(plottools):

alpha := Pi/18.:
a := 2*cos(alpha):
b := 2*sin(alpha):
e := 0.02:
p := [[0,0,0],[a,b,0],[a,b,1],[0,0,1]],
     [[0,e,0],[a,b+e,0],[a,b+e,1],[0,e,1]],
     [[0,0,0],[0,e,0],[0,e,1],[0,0,1]],
     [[a,b,0],[a,b+e,0],[a,b+e,1],[a,b,1]],
     [[0,0,0],[a,b,0],[a,b+e,0],[0,e,0]],
     [[0,0,1],[a,b,1],[a,b+e,1],[0,e,1]]

[[0, 0, 0], [1.969615506, .3472963554, 0], [1.969615506, .3472963554, 1], [0, 0, 1]], [[0, 0.2e-1, 0], [1.969615506, .3672963554, 0], [1.969615506, .3672963554, 1], [0, 0.2e-1, 1]], [[0, 0, 0], [0, 0.2e-1, 0], [0, 0.2e-1, 1], [0, 0, 1]], [[1.969615506, .3472963554, 0], [1.969615506, .3672963554, 0], [1.969615506, .3672963554, 1], [1.969615506, .3472963554, 1]], [[0, 0, 0], [1.969615506, .3472963554, 0], [1.969615506, .3672963554, 0], [0, 0.2e-1, 0]], [[0, 0, 1], [1.969615506, .3472963554, 1], [1.969615506, .3672963554, 1], [0, 0.2e-1, 1]]

(1)

f   := k -> transform((x, y, z) -> [x, y+k, z]):
col := k-> COLOR(RGB, op(ListTools:-Rotate([1, 0, 0], -k))):
t   := TRANSPARENCY(0.5):
PLOT3D(POLYGONS(p, t, col(0)), f(1)(POLYGONS(p, t, col(1))), f(2)(POLYGONS(p, t, col(2))), AXESLABELS(2, 3, 1))

 

PLOT3D(POLYGONS(p, t, col(0)), f(1)(POLYGONS(p, t, col(1))), f(2)(POLYGONS(p, t, col(2))), AXESLABELS(2, 3, 1))

 

PLOT3D(f(2)(POLYGONS(p, t, col(2))), f(1)(POLYGONS(p, t, col(1))), POLYGONS(p, t, col(0)), AXESLABELS(2, 3, 1))

 

 


 

Download Background_Foreground.mw

Please Wait...