File: shadow2.py

package info (click to toggle)
vedo 2025.5.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 10,404 kB
  • sloc: python: 64,792; javascript: 1,932; xml: 437; sh: 139; makefile: 6
file content (19 lines) | stat: -rw-r--r-- 564 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from vedo import *

man = Mesh(dataurl+'man.vtk').c('k9').lighting('glossy')
floor = Box(length=9, width=9, height=0.1).z(-1.6).c('white')
cube = Cube().pos(2,-2,-1)

p1 = Arrow([4,0,4], [0,0,0],  c='red5').scale(0.2)
p2 = Arrow([0,4,4], [0,0,0],  c='green5').scale(0.2)
p3 = Arrow([-4,-4,4], [0,0,0],  c='blue5').scale(0.2)

# Add light sources at the given positions
# (grab the position and color of the arrow object)
l1 = Light(p1)
l2 = Light(p2)
l3 = Light(p3)

plt = Plotter(bg='blackboard').add_shadows()
plt.show(l1, l2, l3, p1, p2, p3, man, floor, cube)