a89742cf |
1 | puts "========" |
2 | puts "OCC24819: TKOpenGl - extend the ray-tracing core by visualization of lines, text and point sprites" |
3 | puts "========" |
4 | |
5 | # setup 3D viewer content |
6 | vinit name=View1 w=512 h=512 |
7 | vglinfo |
8 | |
9 | vvbo 0 |
10 | vsetdispmode 1 |
11 | vsetgradientbg 180 200 255 180 180 180 2 |
12 | # boxes |
13 | box b1 1 1 1 |
14 | vdisplay b1 |
15 | vsetlocation b1 0 0 0.001 |
16 | vsetmaterial b1 Silver |
17 | vsettransparency b1 0.5 |
18 | box b2 3 2 2 1 2 1 |
19 | vdisplay b2 |
20 | vsetmaterial b2 Pewter |
21 | vsettransparency b2 0.8 |
22 | |
23 | # brep text |
24 | text2brep t "text" "Arial" 8 |
25 | vdisplay t |
26 | |
27 | # overlay objects |
28 | voverlaytext "Overlay text!" 200 440 40 |
29 | |
30 | # markers |
31 | vpoint p 1 1 1 |
32 | vdisplay p |
33 | vmarkerstest mTest 7 -3 0 PointsOnSide=5 MarkerType=5 |
34 | |
35 | # 3d text |
29e2c6d2 |
36 | vdrawtext text0 3D_Text -pos 1 2 2 -color 1.0 0.0 0.0 -halign left -valign bottom -angle 0 -zoom 0 -height 20 -aspect regular |
a89742cf |
37 | |
38 | vlight change 0 pos -1 1 1 |
39 | |
40 | vfit |
41 | |
42 | # trihedron |
43 | vzbufftrihedron |
44 | |
45 | # activate ray-tracing |
46 | vrenderparams -raytrace |
47 | |
48 | # orthogonal projection |
49 | set aModeNum 0 |
50 | foreach aFSAAMode {on off} { |
51 | foreach aReflMode {on off} { |
52 | foreach aShadMode {on off} { |
53 | vrenderparams -shadows $aShadMode -reflections $aReflMode -fsaa $aFSAAMode |
54 | vdump $imagedir/${casename}_${aModeNum}.png |
55 | incr aModeNum |
56 | } |
57 | } |
58 | } |
59 | |
60 | # perspective projection |
6b62b2da |
61 | vcamera -persp |
a89742cf |
62 | set aModeNum 0 |
63 | foreach aFSAAMode {on off} { |
64 | foreach aReflMode {on off} { |
65 | foreach aShadMode {on off} { |
66 | vrenderparams -shadows $aShadMode -reflections $aReflMode -fsaa $aFSAAMode |
67 | vdump $imagedir/${casename}_${aModeNum}.png |
68 | incr aModeNum |
69 | } |
70 | } |
71 | } |