0025310: Regressions in visualization
[occt.git] / samples / tcl / raytrace.tcl
CommitLineData
a347ef35 1# Script demonstrating ray tracing in 3d view
12402146 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
a347ef35 15vinit w=1024 h=1024
12402146 16vsetmaterial bottle aluminium
17vdisplay table
18vsetmaterial table bronze
19vsetmaterial table plastic
20vsetcolor table coral2
21vdisplay glass
22vsetmaterial glass plastic
23vsetcolor glass brown
24vsettransparency glass 0.6
25
26# add light source for shadows
27vlight new spot pos -100 -100 300
28
29# set white background and fit view
30vsetcolorbg 255 255 255
31vfit
32
33# set ray tracing
fc73a202 34puts "Trying raytrace mode..."
bc8c79bb 35if { ! [catch {vrenderparams -raytrace -shadows -reflections -fsaa -rayDepth 5}] } {
fc73a202 36 vtextureenv on 1
12402146 37}