Debian Codegraph @

debian/tests/check-cube-dae

raw symbols SCIP
1 #!/bin/sh
2
3 set -e
4
5 CUBE_DAE_FILE_PATH=$AUTOPKGTEST_TMP/cube.dae
6 OUTPUT_PNG=$AUTOPKGTEST_ARTIFACTS/cube_dae.png
7
8 cat <<EOF > $CUBE_DAE_FILE_PATH
9 <?xml version="1.0" encoding="utf-8"?>
10 <COLLADA xmlns="http://www.collada.org/2008/03/COLLADASchema" version="1.5.0">
11 <asset>
12 <created>2005-11-14T02:16:38Z</created>
13 <modified>2005-11-15T11:36:38Z</modified>
14 <revision>1.0</revision>
15 </asset>
16 <library_effects>
17 <effect id="whitePhong">
18 <profile_COMMON>
19 <technique sid="phong1">
20 <phong>
21 <emission>
22 <color>1.0 1.0 1.0 1.0</color>
23 </emission>
24 <ambient>
25 <color>1.0 1.0 1.0 1.0</color>
26 </ambient>
27 <diffuse>
28 <color>1.0 1.0 1.0 1.0</color>
29 </diffuse>
30 <specular>
31 <color>1.0 1.0 1.0 1.0</color>
32 </specular>
33 <shininess>
34 <float>20.0</float>
35 </shininess>
36 <reflective>
37 <color>1.0 1.0 1.0 1.0</color>
38 </reflective>
39 <reflectivity>
40 <float>0.5</float>
41 </reflectivity>
42 <transparent>
43 <color>1.0 1.0 1.0 1.0</color>
44 </transparent>
45 <transparency>
46 <float>1.0</float>
47 </transparency>
48 </phong>
49 </technique>
50 </profile_COMMON>
51 </effect>
52 </library_effects>
53 <library_materials>
54 <material id="whiteMaterial">
55 <instance_effect url="#whitePhong"/>
56 </material>
57 </library_materials>
58 <library_geometries>
59 <geometry id="box" name="box">
60 <mesh>
61 <source id="box-Pos">
62 <float_array id="box-Pos-array" count="24">
63 -0.5 0.5 0.5
64 0.5 0.5 0.5
65 -0.5 -0.5 0.5
66 0.5 -0.5 0.5
67 -0.5 0.5 -0.5
68 0.5 0.5 -0.5
69 -0.5 -0.5 -0.5
70 0.5 -0.5 -0.5
71 </float_array>
72 <technique_common>
73 <accessor source="#box-Pos-array" count="8" stride="3">
74 <param name="X" type="float" />
75 <param name="Y" type="float" />
76 <param name="Z" type="float" />
77 </accessor>
78 </technique_common>
79 </source>
80 <source id="box-0-Normal">
81 <float_array id="box-0-Normal-array" count="18">
82 1.0 0.0 0.0
83 -1.0 0.0 0.0
84 0.0 1.0 0.0
85 0.0 -1.0 0.0
86 0.0 0.0 1.0
87 0.0 0.0 -1.0
88 </float_array>
89 <technique_common>
90 <accessor source="#box-0-Normal-array" count="6" stride="3">
91 <param name="X" type="float"/>
92 <param name="Y" type="float"/>
93 <param name="Z" type="float"/>
94 </accessor>
95 </technique_common>
96 </source>
97 <vertices id="box-Vtx">
98 <input semantic="POSITION" source="#box-Pos"/>
99 </vertices>
100 <polygons count="6" material="WHITE">
101 <input semantic="VERTEX" source="#box-Vtx" offset="0"/>
102 <input semantic="NORMAL" source="#box-0-Normal" offset="1"/>
103 <p>0 4 2 4 3 4 1 4</p>
104 <p>0 2 1 2 5 2 4 2</p>
105 <p>6 3 7 3 3 3 2 3</p>
106 <p>0 1 4 1 6 1 2 1</p>
107 <p>3 0 7 0 5 0 1 0</p>
108 <p>5 5 7 5 6 5 4 5</p>
109 </polygons>
110 </mesh>
111 </geometry>
112 </library_geometries>
113 <library_visual_scenes>
114 <visual_scene id="DefaultScene">
115 <node id="Box" name="Box">
116 <translate> 0 0 0</translate>
117 <rotate> 0 0 1 30</rotate>
118 <rotate> 0 1 0 20</rotate>
119 <rotate> 1 0 0 10</rotate>
120 <scale> 1 1 1</scale>
121 <instance_geometry url="#box">
122 <bind_material>
123 <technique_common>
124 <instance_material symbol="WHITE" target="#whiteMaterial"/>
125 </technique_common>
126 </bind_material>
127 </instance_geometry>
128 </node>
129 </visual_scene>
130 </library_visual_scenes>
131 <scene>
132 <instance_visual_scene url="#DefaultScene"/>
133 </scene>
134 </COLLADA>
135 EOF
136
137 echo ==========
138 echo Smoke Test
139 echo ==========
140 f3d --no-render $CUBE_DAE_FILE_PATH
141
142 echo ===========================
143 echo Generate the new screenshot
144 echo ===========================
145 xvfb-run f3d -s --resolution=640,480 --output=$OUTPUT_PNG $CUBE_DAE_FILE_PATH
146
147 echo ================
148 echo Compare with ref
149 echo ================
150 idiff -v -failpercent 1 -warnpercent 1 debian/tests/cube_dae_ref.png $OUTPUT_PNG