0024887: Visualization - revise and extend Raytracing controls
[occt.git] / samples / tcl / raytrace.tcl
CommitLineData
12402146 1# Script reproducing creation of bottle model as described in OCCT Tutorial
2
3# make bottle by calling another script
4source [file join [file dirname [info script]] bottle.tcl]
5
6# make table and a glass
7box table -50 -50 -10 100 100 10
8pcone glass_out 7 9 25
9pcone glass_in 7 9 25
10ttranslate glass_in 0 0 0.2
11bcut glass glass_out glass_in
12ttranslate glass -30 -30 0
13
14# show table and glass
15vsetmaterial bottle aluminium
16vdisplay table
17vsetmaterial table bronze
18vsetmaterial table plastic
19vsetcolor table coral2
20vdisplay glass
21vsetmaterial glass plastic
22vsetcolor glass brown
23vsettransparency glass 0.6
24
25# add light source for shadows
26vlight new spot pos -100 -100 300
27
28# set white background and fit view
29vsetcolorbg 255 255 255
30vfit
31
32# set ray tracing
fc73a202 33puts "Trying raytrace mode..."
bc8c79bb 34if { ! [catch {vrenderparams -raytrace -shadows -reflections -fsaa -rayDepth 5}] } {
fc73a202 35 vtextureenv on 1
12402146 36}