File: spotlight.dem

package info (click to toggle)
gnuplot 6.0.2%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 14,936 kB
  • sloc: ansic: 95,319; cpp: 7,590; makefile: 2,470; javascript: 2,328; sh: 1,531; lisp: 664; perl: 304; pascal: 191; tcl: 88; python: 46
file content (32 lines) | stat: -rw-r--r-- 937 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#
# Illustrate use of secondary spotlight in pm3d lighting model
#
unset key
unset colorbox
unset tics
unset border
set parametric
set dummy u, v
set view  equal xyz
set view 90., 0., 1.6
set samples 95
set isosamples 95
set xyplane at 0
set pm3d depthorder 
set pm3d lighting primary 0.5 specular 0.2 spec2 0.5
set pm3d spotlight rgb 0xff0044 rot_x 35 rot_z 0 Phong 10.0

# Bind hot keys to move spotlight origin phi/psi
spot_x = 35
spot_z = 0
bind all 'x' "spot_x = spot_x+5.; set pm3d spotlight rot_x spot_x; replot"
bind all 'X' "spot_x = spot_x-5.; set pm3d spotlight rot_x spot_x; replot"
bind all 'Y' "spot_z = spot_z-5.; set pm3d spotlight rot_z spot_z; replot"
bind all 'y' "spot_z = spot_z+5.; set pm3d spotlight rot_z spot_z; replot"

set title "In interactive terminals,\nHot keys x/X and y/Y move red spotlight"
splot cos(u)*cos(v),cos(u)*sin(v),sin(u) with pm3d fc "gray"

pause -1 "Hot keys x/X y/Y move spotlight"

reset