-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcube.dae
237 lines (213 loc) · 5.92 KB
/
cube.dae
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
<?xml version="1.0" encoding="UTF-8"?>
<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<!--
This file describes a scene with a single cube.
The vertex, normal, and uv data arrays are all the same length so that
they can be indexed simultaneously.
Here is a rough outline of its structure:
effect "effectColor"
lambert
diffuse 0.5 0.5 0.5 1.0
material "matColor"
instance_effect "effectColor"
geometry "cubeGeometry"
mesh
source "cubeVerticesSource"
float_array "cubeVerticesData": 24x (x,y,z) = 72
source "cubeNormalsSource"
float_array "cubeNormalsData": 24x (x,y,z) = 72
source "cubeTextureUVsSource"
float_array "cubeTextureUVsData": 24x (u,v) = 48
vertices "cubeVertices"
input POSITION "cubeVerticesSource"
triangles
material "cubeTexture"
input VERTEX "cubeVertices"
input NORMAL "cubeNormalsSource"
input TEXCOORD "cubeTextureUVsSource"
36 (shared) indices
scene "cubeScene"
node "cube"
geometry "cubeGeometry"
bind_material "cubeTexture" -> "matColor"
-->
<asset>
<contributor>
<authoring_tool>Text editor</authoring_tool>
</contributor>
<unit meter="1.000000"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_effects>
<effect id="effectColor">
<profile_COMMON>
<technique sid="common">
<lambert>
<diffuse>
<color>0.5 0.5 0.5 1</color>
</diffuse>
</lambert>
</technique>
</profile_COMMON>
</effect>
</library_effects>
<library_materials>
<material id="matColor" name="MatColor">
<instance_effect url="#effectColor"/>
</material>
</library_materials>
<library_geometries>
<geometry id="cubeGeometry" name="CubeGeometry">
<mesh>
<!--
Vertices: Faces:
f- - - -g +- - - -+
/. /| /. 5 /| 3 back
/ . / | / . / |
e- - - -h | 2 +- - - -+ 1|
| b . .|. c z right | . . .|. +
| . | / | /y | . 4 | /
|. |/ |/ |. |/
a- - - -d + - - x +- - - -+
6
bottom
-->
<!--
Vertex data:
8 vertices
* 3 copies of each vertex (one for each face it is part of because
this needs to be kept in sync with normal and texture arrays)
= 24 vertices
* 3 values (x,y,z) for each vertex
= 72 values
-->
<source id="cubeVerticesSource">
<float_array id="cubeVerticesData" count="72">
0 0 0 <!-- 0 a (faces: 2,4,6) -->
0 0 0
0 0 0
0 1 0 <!-- 3 b (faces: 2,3,6) -->
0 1 0
0 1 0
1 1 0 <!-- 6 c (faces: 1,3,6) -->
1 1 0
1 1 0
1 0 0 <!-- 9 d (faces: 1,4,6) -->
1 0 0
1 0 0
0 0 1 <!-- 12 e (faces: 2,4,5) -->
0 0 1
0 0 1
0 1 1 <!-- 15 f (faces: 2,3,5) -->
0 1 1
0 1 1
1 1 1 <!-- 18 g (faces: 1,3,5) -->
1 1 1
1 1 1
1 0 1 <!-- 21 h (faces: 1,4,5) -->
1 0 1
1 0 1
</float_array>
<technique_common>
<accessor source="#cubeVerticesData" count="24" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<!--
Normal data: Must correspond 1-for-1 with Vertex data.
-->
<source id="cubeNormalsSource">
<float_array id="cubeNormalsData" count="72">
-1 0 0 <!-- 0 a (faces: 2,4,6) -->
0 -1 0
0 0 -1
-1 0 0 <!-- 3 b (faces: 2,3,6) -->
0 1 0
0 0 -1
1 0 0 <!-- 6 c (faces: 1,3,6) -->
0 1 0
0 0 -1
1 0 0 <!-- 9 d (faces: 1,4,6) -->
0 -1 0
0 0 -1
-1 0 0 <!-- 12 e (faces: 2,4,5) -->
0 -1 0
0 0 1
-1 0 0 <!-- 15 f (faces: 2,3,5) -->
0 1 0
0 0 1
1 0 0 <!-- 18 g (faces: 1,3,5) -->
0 1 0
0 0 1
1 0 0 <!-- 21 h (faces: 1,4,5) -->
0 -1 0
0 0 1
</float_array>
<technique_common>
<accessor source="#cubeNormalsData" count="24" stride="3">
<param name="nX" type="float"/>
<param name="nY" type="float"/>
<param name="nZ" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="cubeVertices">
<input semantic="POSITION" source="#cubeVerticesSource"/>
</vertices>
<!--
3- - - -2
| - |
| # | Each face = 2 triangles (ccw)
| - | = 1-2-3 + 1-3-4
4- - - -1
Each index in the triangles array in an index into each of the
3 arrays (vertex, normal, uv).
The same index is used for each array because offset="0"
-->
<triangles count="12" material="cubeColor">
<input semantic="VERTEX" offset="0" source="#cubeVertices"/>
<input semantic="NORMAL" offset="0" source="#cubeNormalsSource"/>
<p>
<!-- Face 1: cghd = cgh + chd -->
6 18 21
6 21 9
<!-- Face 2: aefb = aef + afb -->
0 12 15
0 15 3
<!-- Face 3: gcbf = gcb + gbf -->
19 7 4
19 4 16
<!-- Face 4: dhea = dhe + dea -->
10 22 13
10 13 1
<!-- Face 5: hgfe = hgf + hfe -->
23 20 17
23 17 14
<!-- Face 6: cdab = cda + cab -->
8 11 2
8 2 5
</p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_visual_scenes>
<visual_scene id="cubeScene">
<node id="cube" name="Cube">
<instance_geometry url="#cubeGeometry">
<bind_material>
<technique_common>
<instance_material symbol="cubeColor" target="#matColor"/>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#cubeScene"/>
</scene>
</COLLADA>