1 # Script demonstrating ray tracing in 3d view
3 # make bottle by calling another script
4 source [file join [file dirname [info script]] bottle.tcl]
6 # make table and a glass
7 box table -50 -50 -10 100 100 10
10 ttranslate glass_in 0 0 0.2
11 bcut glass glass_out glass_in
12 ttranslate glass -30 -30 0
14 # show table and glass
16 vsetmaterial bottle aluminium
18 vsetmaterial table bronze
19 vsetmaterial table plastic
20 vsetcolor table coral2
22 vsetmaterial glass plastic
24 vsettransparency glass 0.6
26 # add light source for shadows
27 vlight new spot pos -100 -100 300
29 # set white background and fit view
30 vsetcolorbg 255 255 255
34 puts "Trying raytrace mode..."
35 if { ! [catch {vrenderparams -raytrace -shadows -reflections -fsaa -rayDepth 5}] } {