I stumbled accross the following.
If I plot, e.g. a cube using pm3d
and define the sides to be semitransparent, I would expect that the cube looks the same if I rotate it by multiple of 90 degrees.
However, apparently depending on the viewing angle a particular surface appears brighter or darker than the others. In the example below the views at 30 and 120 degrees have 3 different shades of red whereas the view at 210 and 300 degrees have only 2 shades of red. There is no pm3d lighting
involved.
Questions:
How can this be explained? How can this be avoided? Is something wrong with my definition of the cube?
Did I miss anything in the documentation under help pm3d
or help pm3d algorithm
or help pm3d color_assignment
? Am I using a too old gnuplot version (5.2.8) or "wrong" terminal (wxt)?
Code:
### semitransparent 3D surfaces
reset session
$Cube <<EOD
0 0 0
0 0 1
0 1 1
0 1 0
0 0 0
1 0 0
1 0 1
1 1 1
1 1 0
1 0 0
0 0 0
1 0 0
1 1 0
0 1 0
0 0 0
0 0 1
1 0 1
1 1 1
0 1 1
0 0 1
EOD
set view equal xyz
set cbrange [0.9:1]
set palette defined (1 'red')
set pm3d depthorder hidden3d
set pm3d implicit
unset hidden3d
unset label
unset tics
unset border
unset key
unset colorbox
set multiplot layout 2,3
a=75
b=30
r=1.3
set title sprintf("opaque view: %d, %d",a,b)
set view a,b,r
set style fill transparent solid 1
splot $Cube u 1:2:3:(1) w l lw 0.5 lc "black"
set style fill transparent solid 0.3
do for [i=30:300:90] {
set title sprintf("transparent view: %d, %d",a,i)
set view a,i
replot
}
unset multiplot
### end of code
Result:
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…