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