0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / samples / tcl / raytrace.tcl
1 # Script demonstrating ray tracing in 3d view
2
3 #Category: Visualization
4 #Title: Ray tracing
5
6 # Ray-Tracing doesn't work with Compatible Profile on macOS
7 pload VISUALIZATION
8 if { $::tcl_platform(os) == "Darwin" } { vcaps -core }
9
10 # make bottle by calling another script
11 source [file join [file dirname [info script]] bottle.tcl]
12
13 # make table and a glass
14 box table -50 -50 -10 100 100 10
15 pcone glass_out 7 9 25
16 pcone glass_in 7 9 25
17 ttranslate glass_in 0 0 0.2
18 bcut glass glass_out glass_in
19 ttranslate glass -30 -30 0
20
21 # show table and glass
22 vinit w=1024 h=1024
23 vsetmaterial bottle aluminium
24 vdisplay table
25 vsetmaterial table bronze
26 vsetmaterial table plastic
27 vsetcolor table coral2
28 vdisplay glass
29 vsetmaterial glass plastic
30 vsetcolor glass brown
31 vsettransparency glass 0.6
32
33 # add light source for shadows
34 vlight spot -type SPOT -pos -100 -100 300
35
36 # set white background and fit view
37 vbackground -color WHITE
38 vfit
39
40 # set ray tracing
41 puts "Trying raytrace mode..."
42 if { ! [catch {vrenderparams -raytrace -shadows -reflections -fsaa -rayDepth 5}] } {
43   vtextureenv on 1
44 }