0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / tests / v3d / light_source / manipulator
1 puts "==================================================="
2 puts "0031704: Visualization - add an interactive object AIS_LightSource representing a light source"
3 puts "==================================================="
4
5 pload MODELING VISUALIZATION
6 vclear
7 vinit View1
8 vlight -clear
9 vbackground -color GRAY
10 vrenderparams -shadingModel PHONG
11 vlight amblight -type AMBIENT -color WHITE -intensity 0.1
12 box b 0 0 0 30 30 30
13 vdisplay b -dispMode 1
14 vsetmaterial b Brass
15 vfit
16 vlight aSpotLight -type SPOTLIGHT -pos 15 -10 15 -dir 0 1 0 -color RED -display
17
18 puts "=== Attach manipulator ==="
19 vmanipulator m -attach aSpotLight -adjustPosition location 
20 vdump $imagedir/${casename}_manip.png
21
22 puts "=== Test manipulator - rotation ==="
23 vmanipulator m -followRotation 1
24
25 set mouse_pick_rotate {128 231}
26 set mouse_drag_rotate {98 200}
27
28 vmoveto {*}$mouse_pick_rotate
29 vselect {*}$mouse_pick_rotate
30 vmanipulator m -startTransform {*}$mouse_pick_rotate
31 vmanipulator m -transform {*}$mouse_drag_rotate
32 vmanipulator m -stopTransform
33 vselect 0 0
34 vmoveto {*}$mouse_drag_rotate
35 vdump $imagedir/${casename}_rot.png
36
37 puts "=== Test manipulator - translation ==="
38 set mouse_pick_translate {87 315}
39 set mouse_drag_translate {167 358}
40
41 vmoveto {*}$mouse_pick_translate 
42 vselect {*}$mouse_pick_translate 
43 vmanipulator m -startTransform {*}$mouse_pick_translate 
44 vmanipulator m -transform {*}$mouse_drag_translate 
45 vmanipulator m -stopTransform
46 vselect 0 0
47 vmoveto {*}$mouse_drag_translate
48 vmanipulator m -detach
49 vremove aSpotLight
50 vdump $imagedir/${casename}_trans.png