0027158: BRepMesh manage vertex tolerance in parametric space in improper way
[occt.git] / samples / tcl / raytrace.tcl
CommitLineData
a347ef35 1# Script demonstrating ray tracing in 3d view
12402146 2
ab91ab6f 3#Category: Visualization
4#Title: Ray tracing
5
12402146 6# make bottle by calling another script
7source [file join [file dirname [info script]] bottle.tcl]
8
9# make table and a glass
10box table -50 -50 -10 100 100 10
11pcone glass_out 7 9 25
12pcone glass_in 7 9 25
13ttranslate glass_in 0 0 0.2
14bcut glass glass_out glass_in
15ttranslate glass -30 -30 0
16
17# show table and glass
a347ef35 18vinit w=1024 h=1024
12402146 19vsetmaterial bottle aluminium
20vdisplay table
21vsetmaterial table bronze
22vsetmaterial table plastic
23vsetcolor table coral2
24vdisplay glass
25vsetmaterial glass plastic
26vsetcolor glass brown
27vsettransparency glass 0.6
28
29# add light source for shadows
30vlight new spot pos -100 -100 300
31
32# set white background and fit view
33vsetcolorbg 255 255 255
34vfit
35
36# set ray tracing
fc73a202 37puts "Trying raytrace mode..."
bc8c79bb 38if { ! [catch {vrenderparams -raytrace -shadows -reflections -fsaa -rayDepth 5}] } {
fc73a202 39 vtextureenv on 1
12402146 40}