summaryrefslogtreecommitdiff
path: root/gen.cpp
diff options
context:
space:
mode:
authorknolax <1339802534.kk@gmail.com>2017-02-28 11:05:31 -0500
committerknolax <1339802534.kk@gmail.com>2017-02-28 11:05:31 -0500
commitcf3f284a5f24bd02006e9ff929cc29d10c428a3e (patch)
treee23fabd9a851ffdce0b48783c1903f40b6bfe573 /gen.cpp
parent0c2c626fbdfd7836f086eb8f4039a394368b7974 (diff)
textures loaded properly now but without functional alpha layer.
Diffstat (limited to 'gen.cpp')
-rw-r--r--gen.cpp37
1 files changed, 21 insertions, 16 deletions
diff --git a/gen.cpp b/gen.cpp
index 167d9e7..5ac79d0 100644
--- a/gen.cpp
+++ b/gen.cpp
@@ -9,43 +9,48 @@ int main () {
0.5, 0.5, 0.5,
0.5, -0.5, 0.5,
-0.5, -0.5, 0.5,
- //normal positions
+ //normal positions : 8
1.0, 0.0, 0.0,
-1.0, 0.0, 0.0,
0.0, 1.0, 0.0,
0.0, -1.0, 0.0,
0.0, 0.0, 1.0,
0.0, 0.0, -1.0,
+ //texcoords : 14
+ 0.0, 0.0, 0.0,
+ 1.0, 0.0, 0.0,
+ 0.0, 1.0, 0.0,
+ 1.0, 1.0, 0.0,
};
//polygons of the box mode based on the vertex data.
//they must be clockwise from the front so that they are culled when not
//seen
int elementdata[] = {
- 0,13, 1,13, 3,13,
- 3,13, 1,13, 2,13,
+ 0,13,16, 1,13,17, 3,13,14,
+ 3,13,14, 1,13,17, 2,13,15,
- 1,8, 5,8, 2,8,
- 2,8, 5,8, 6,8,
+ 1,8,16, 5,8,17, 2,8,14,
+ 2,8,14, 5,8,17, 6,8,15,
- 5,12, 4,12, 6,12,
- 4,12, 7,12, 6,12,
+ 5,12,16, 4,12,17, 6,12,14,
+ 4,12,17, 7,12,15, 6,12,14,
- 4,9, 0,9, 7,9,
- 0,9, 3,9, 7,9,
+ 4,9,16, 0,9,17, 7,9,14,
+ 0,9,17, 3,9,15, 7,9,14,
- 3,11, 6,11, 7,11,
- 2,11, 6,11, 3,11,
+ 3,11,14, 6,11,17, 7,11,16,
+ 2,11,15, 6,11,17, 3,11,14,
- 0,10, 4,10, 5,10,
- 5,10, 1,10, 0,10,
+ 0,10,14, 4,10,15, 5,10,17,
+ 5,10,17, 1,10,16, 0,10,14,
};
int i = 0;
printf("float vertexdata[] = {\n");
- while (i < 72) {
+ while (i < 108) {
printf("%f,%f,%f, ",vertexdata[(elementdata[i] * 3)],vertexdata[(elementdata[i] * 3) + 1],vertexdata[(elementdata[i] * 3 )+ 2]);
- if (((i + 1) % 6) == 0) {
+ if (((i + 1) % 9) == 0) {
printf("\n");
- } else if (((i + 1) % 2) == 0) {
+ } else if (((i + 1) % 3) == 0) {
printf("\t");
}
i++;