1 # Script demonstrating ray tracing in 3d view
3 #Category: Visualization
6 # make bottle by calling another script
7 source [file join [file dirname [info script]] bottle.tcl]
9 # make table and a glass
10 box table -50 -50 -10 100 100 10
11 pcone glass_out 7 9 25
13 ttranslate glass_in 0 0 0.2
14 bcut glass glass_out glass_in
15 ttranslate glass -30 -30 0
17 # show table and glass
19 vsetmaterial bottle aluminium
21 vsetmaterial table bronze
22 vsetmaterial table plastic
23 vsetcolor table coral2
25 vsetmaterial glass plastic
27 vsettransparency glass 0.6
29 # add light source for shadows
30 vlight new spot pos -100 -100 300
32 # set white background and fit view
33 vsetcolorbg 255 255 255
37 puts "Trying raytrace mode..."
38 if { ! [catch {vrenderparams -raytrace -shadows -reflections -fsaa -rayDepth 5}] } {