... | ... |
@@ -12,6 +12,8 @@ |
12 | 12 |
// 180216: calloc is better than malloc when you may have undefined data in parts of the texture! |
13 | 13 |
// 190416: Skipped testing the last four bytes of the 12-byte heading. That is the origin of the |
14 | 14 |
// image which is usually 0. It is now ignored. |
15 |
+// 220218: Big change: Removed the power of 2. GPUs with that limitation are gone now. |
|
16 |
+// This simplifies both the code and the interface. |
|
15 | 17 |
|
16 | 18 |
// NOTE: LoadTGA does NOT support all TGA variants! You may need to re-save your TGA |
17 | 19 |
// with different settings to find a suitable format. |
... | ... |
@@ -29,7 +31,7 @@ void LoadTGASetMipmapping(bool active) |
29 | 31 |
gMipmap = active; |
30 | 32 |
} |
31 | 33 |
|
32 |
-bool LoadTGATextureData(char *filename, TextureData *texture) // Loads A TGA File Into Memory |
|
34 |
+bool LoadTGATextureData(const char *filename, TextureData *texture) // Loads A TGA File Into Memory |
|
33 | 35 |
{ |
34 | 36 |
GLuint i; |
35 | 37 |
GLubyte |
... | ... |
@@ -43,7 +45,7 @@ bool LoadTGATextureData(char *filename, TextureData *texture) // Loads A TGA Fil |
43 | 45 |
imageSize, // Used To Store The Image Size When Setting Aside Ram |
44 | 46 |
temp; // Temporary Variable |
45 | 47 |
long rowSize, stepSize, bytesRead; |
46 |
- long w, h; |
|
48 |
+// long w, h; |
|
47 | 49 |
GLubyte *rowP; |
48 | 50 |
int err; |
49 | 51 |
GLubyte rle; |
... | ... |
@@ -109,20 +111,21 @@ bool LoadTGATextureData(char *filename, TextureData *texture) // Loads A TGA Fil |
109 | 111 |
return false; |
110 | 112 |
} |
111 | 113 |
flipped = (header[5] & 32) != 0; // Testa om flipped |
112 |
- |
|
113 |
- w = 1; |
|
114 |
- while (w < texture->width) w = w << 1; |
|
115 |
- h = 1; |
|
116 |
- while (h < texture->height) h = h << 1; |
|
117 |
- texture->texWidth = (GLfloat)texture->width / w; |
|
118 |
- texture->texHeight = (GLfloat)texture->height / h; |
|
114 |
+ |
|
115 |
+// That old power of 2 is no longer needed! |
|
116 |
+// w = 1; |
|
117 |
+// while (w < texture->width) w = w << 1; |
|
118 |
+// h = 1; |
|
119 |
+// while (h < texture->height) h = h << 1; |
|
120 |
+// texture->texWidth = (GLfloat)texture->width / w; |
|
121 |
+// texture->texHeight = (GLfloat)texture->height / h; |
|
119 | 122 |
|
120 | 123 |
|
121 | 124 |
texture->bpp = header[4]; // Grab The TGA's Bits Per Pixel (24 or 32) |
122 | 125 |
bytesPerPixel = texture->bpp/8; // Divide By 8 To Get The Bytes Per Pixel |
123 |
- imageSize = w * h * bytesPerPixel; // Calculate The Memory Required For The TGA Data |
|
126 |
+ imageSize = texture->width * texture->height * bytesPerPixel; // Calculate The Memory Required For The TGA Data |
|
124 | 127 |
rowSize = texture->width * bytesPerPixel; // Image memory per row |
125 |
- stepSize = w * bytesPerPixel; // Memory per row |
|
128 |
+ stepSize = texture->width * bytesPerPixel; // Memory per row |
|
126 | 129 |
texture->imageData = (GLubyte *)calloc(1, imageSize); // Reserve Memory To Hold The TGA Data |
127 | 130 |
if (texture->imageData == NULL) // Does The Storage Memory Exist? |
128 | 131 |
{ |
... | ... |
@@ -133,7 +136,7 @@ bool LoadTGATextureData(char *filename, TextureData *texture) // Loads A TGA Fil |
133 | 136 |
// Set rowP and step depending on direction |
134 | 137 |
// Inverted this 120131, since a texture came out wrong. |
135 | 138 |
// I am still not sure this is OK. |
136 |
- if (!flipped) |
|
139 |
+ if (flipped) |
|
137 | 140 |
{ |
138 | 141 |
step = -stepSize; |
139 | 142 |
rowP = &texture->imageData[imageSize - stepSize]; |
... | ... |
@@ -204,13 +207,13 @@ bool LoadTGATextureData(char *filename, TextureData *texture) // Loads A TGA Fil |
204 | 207 |
} |
205 | 208 |
fclose (file); |
206 | 209 |
|
207 |
-texture->w = w; |
|
208 |
-texture->h = h; |
|
210 |
+//texture->w = w; |
|
211 |
+//texture->h = h; |
|
209 | 212 |
|
210 | 213 |
return true; // Texture loading Went Ok, Return True |
211 | 214 |
} |
212 | 215 |
|
213 |
-bool LoadTGATexture(char *filename, TextureData *texture) // Loads A TGA File Into Memory and creates texture object |
|
216 |
+bool LoadTGATexture(const char *filename, TextureData *texture) // Loads A TGA File Into Memory and creates texture object |
|
214 | 217 |
{ |
215 | 218 |
char ok; |
216 | 219 |
GLuint type = GL_RGBA; // Set The Default GL Mode To RBGA (32 BPP) |
... | ... |
@@ -232,7 +235,7 @@ bool LoadTGATexture(char *filename, TextureData *texture) // Loads A TGA File In |
232 | 235 |
{ |
233 | 236 |
type=GL_RGB; // If So Set The 'type' To GL_RGB |
234 | 237 |
} |
235 |
- glTexImage2D(GL_TEXTURE_2D, 0, type, texture->w, texture->h, 0, type, GL_UNSIGNED_BYTE, texture[0].imageData); |
|
238 |
+ glTexImage2D(GL_TEXTURE_2D, 0, type, texture->width, texture->height, 0, type, GL_UNSIGNED_BYTE, texture[0].imageData); |
|
236 | 239 |
|
237 | 240 |
if (gMipmap) |
238 | 241 |
{ |
... | ... |
@@ -243,7 +246,7 @@ bool LoadTGATexture(char *filename, TextureData *texture) // Loads A TGA File In |
243 | 246 |
return true; // Texture Building Went Ok, Return True |
244 | 247 |
} |
245 | 248 |
|
246 |
-void LoadTGATextureSimple(char *filename, GLuint *tex) // If you really only need the texture object. |
|
249 |
+void LoadTGATextureSimple(const char *filename, GLuint *tex) // If you really only need the texture object. |
|
247 | 250 |
{ |
248 | 251 |
TextureData texture; |
249 | 252 |
memset(&texture, 0, sizeof(texture)); // Bug fix 130905. |
... | ... |
@@ -324,7 +327,8 @@ int SaveDataToTGA(char *filename, |
324 | 327 |
|
325 | 328 |
fclose(file); |
326 | 329 |
// release the memory |
327 |
- free(imageData); |
|
330 |
+// No, this is the responsability of the host! |
|
331 |
+// free(imageData); |
|
328 | 332 |
|
329 | 333 |
return(TGA_OK); |
330 | 334 |
} |
... | ... |
@@ -44,10 +44,10 @@ typedef struct TextureData // Create A Structure for .tga loading. |
44 | 44 |
GLfloat texWidth, texHeight; |
45 | 45 |
} TextureData, *TextureDataPtr; // Structure Name |
46 | 46 |
|
47 |
-bool LoadTGATexture(char *filename, TextureData *texture); |
|
48 |
-void LoadTGATextureSimple(char *filename, GLuint *tex); |
|
47 |
+bool LoadTGATexture(const char *filename, TextureData *texture); |
|
48 |
+void LoadTGATextureSimple(const char *filename, GLuint *tex); |
|
49 | 49 |
void LoadTGASetMipmapping(bool active); |
50 |
-bool LoadTGATextureData(char *filename, TextureData *texture); |
|
50 |
+bool LoadTGATextureData(const char *filename, TextureData *texture); |
|
51 | 51 |
|
52 | 52 |
// Constants for SaveTGA |
53 | 53 |
#define TGA_ERROR_FILE_OPEN -5 |
... | ... |
@@ -62,12 +62,14 @@ |
62 | 62 |
// 131014: Added TransposeMat3 (although I doubt its importance) |
63 | 63 |
// 140213: Corrected mat3tomat4. (Were did the correction in 130924 go?) |
64 | 64 |
// 151210: Added printMat4 and printVec3. |
65 |
-// 160302: Added empty constuctors for vec3 and vec4. |
|
65 |
+// 160302: Added empty constructors for vec3 and vec4. |
|
66 | 66 |
// 170221: Uses _WIN32 instead of WIN32 |
67 | 67 |
// 170331: Added stdio.h for printMat4 and printVec3 |
68 | 68 |
// 180314: Added some #defines for moving closer to GLSL (dot, cross...). |
69 | 69 |
// 2021-05-15: Constructiors for vec3 etc replaced in order to avoid |
70 | 70 |
// problems with some C++ compilers. |
71 |
+// 2022-05-14: Corrected transposed version of lookAtv. |
|
72 |
+// 2023-01-31: Added shader upload utility functions. |
|
71 | 73 |
|
72 | 74 |
// You may use VectorUtils as you please. A reference to the origin is appreciated |
73 | 75 |
// but if you grab some snippets from it without reference... no problem. |
... | ... |
@@ -559,7 +561,7 @@ char transposed = 0; |
559 | 561 |
// } |
560 | 562 |
|
561 | 563 |
// Complete transpose! |
562 |
- mat4 Transpose(mat4 m) |
|
564 |
+ mat4 transpose(mat4 m) |
|
563 | 565 |
{ |
564 | 566 |
mat4 a; |
565 | 567 |
|
... | ... |
@@ -629,7 +631,7 @@ mat4 ArbRotate(vec3 axis, GLfloat fi) |
629 | 631 |
R.m[12] = 0.0; R.m[13] = 0.0; R.m[14] = 0.0; R.m[15] = 1.0; |
630 | 632 |
} |
631 | 633 |
|
632 |
- Rt = Transpose(R); // Transpose = Invert -> felet ej i Transpose, och det �r en ortonormal matris |
|
634 |
+ Rt = transpose(R); // Transpose = Invert -> felet ej i Transpose, och det �r en ortonormal matris |
|
633 | 635 |
|
634 | 636 |
Raxel = Rx(fi); // Rotate around x axis |
635 | 637 |
|
... | ... |
@@ -701,10 +703,16 @@ mat4 lookAtv(vec3 p, vec3 l, vec3 v) |
701 | 703 |
// n.x, n.y, n.z, 0, |
702 | 704 |
// 0, 0, 0, 1 }}; |
703 | 705 |
// VS friendly version: |
706 |
+ if (transposed) |
|
707 |
+ rot = SetMat4(u.x, v.x, n.x, 0, |
|
708 |
+ u.y, v.y, n.y, 0, |
|
709 |
+ u.z, v.z, n.z, 0, |
|
710 |
+ 0, 0, 0, 1); |
|
711 |
+ else |
|
704 | 712 |
rot = SetMat4(u.x, u.y, u.z, 0, |
705 |
- v.x, v.y, v.z, 0, |
|
706 |
- n.x, n.y, n.z, 0, |
|
707 |
- 0, 0, 0, 1); |
|
713 |
+ v.x, v.y, v.z, 0, |
|
714 |
+ n.x, n.y, n.z, 0, |
|
715 |
+ 0, 0, 0, 1); |
|
708 | 716 |
trans = T(-p.x, -p.y, -p.z); |
709 | 717 |
return Mult(rot, trans); |
710 | 718 |
} |
... | ... |
@@ -728,23 +736,18 @@ mat4 lookAt(GLfloat px, GLfloat py, GLfloat pz, |
728 | 736 |
|
729 | 737 |
// Creates a projection matrix like gluPerspective or glFrustum. |
730 | 738 |
// Upload to your shader as usual. |
739 |
+// 2022: Yet another fix. Was it correct this time? |
|
731 | 740 |
mat4 perspective(float fovyInDegrees, float aspectRatio, |
732 | 741 |
float znear, float zfar) |
733 | 742 |
{ |
734 |
- float ymax, xmax; |
|
735 |
- ymax = znear * tanf(fovyInDegrees * M_PI / 360.0); |
|
736 |
- if (aspectRatio < 1.0) |
|
737 |
- { |
|
738 |
- ymax = znear * tanf(fovyInDegrees * M_PI / 360.0); |
|
739 |
- xmax = ymax * aspectRatio; |
|
740 |
- } |
|
741 |
- else |
|
742 |
- { |
|
743 |
- xmax = znear * tanf(fovyInDegrees * M_PI / 360.0); |
|
744 |
- ymax = xmax / aspectRatio; |
|
745 |
- } |
|
746 |
- |
|
747 |
- return frustum(-xmax, xmax, -ymax, ymax, znear, zfar); |
|
743 |
+ float f = 1.0/tan(fovyInDegrees * M_PI / 360.0); |
|
744 |
+ mat4 m = SetMat4(f/aspectRatio, 0, 0, 0, |
|
745 |
+ 0, f, 0, 0, |
|
746 |
+ 0, 0, (zfar+znear)/(znear-zfar), 2*zfar*znear/(znear-zfar), |
|
747 |
+ 0, 0, -1, 0); |
|
748 |
+ if (transposed) |
|
749 |
+ m = transpose(m); |
|
750 |
+ return m; |
|
748 | 751 |
} |
749 | 752 |
|
750 | 753 |
mat4 frustum(float left, float right, float bottom, float top, |
... | ... |
@@ -775,7 +778,7 @@ mat4 frustum(float left, float right, float bottom, float top, |
775 | 778 |
matrix.m[15] = 0.0; |
776 | 779 |
|
777 | 780 |
if (!transposed) |
778 |
- matrix = Transpose(matrix); |
|
781 |
+ matrix = transpose(matrix); |
|
779 | 782 |
|
780 | 783 |
return matrix; |
781 | 784 |
} |
... | ... |
@@ -1026,3 +1029,97 @@ void printVec3(vec3 in) |
1026 | 1029 |
{ |
1027 | 1030 |
printf("(%f, %f, %f)\n", in.x, in.y, in.z); |
1028 | 1031 |
} |
1032 |
+ |
|
1033 |
+ |
|
1034 |
+ |
|
1035 |
+/* Utility functions for easier uploads to shaders with error messages. */ |
|
1036 |
+// NEW as prototype 2022, added to VU 2023 |
|
1037 |
+ |
|
1038 |
+#define NUM_ERRORS 8 |
|
1039 |
+ |
|
1040 |
+static void ReportError(const char *caller, const char *name) |
|
1041 |
+{ |
|
1042 |
+ static unsigned int draw_error_counter = 0; |
|
1043 |
+ if(draw_error_counter < NUM_ERRORS) |
|
1044 |
+ { |
|
1045 |
+ fprintf(stderr, "%s warning: '%s' not found in shader!\n", caller, name); |
|
1046 |
+ draw_error_counter++; |
|
1047 |
+ } |
|
1048 |
+ else if(draw_error_counter == NUM_ERRORS) |
|
1049 |
+ { |
|
1050 |
+ fprintf(stderr, "%s: Number of errors bigger than %i. No more vill be printed.\n", caller, NUM_ERRORS); |
|
1051 |
+ draw_error_counter++; |
|
1052 |
+ } |
|
1053 |
+} |
|
1054 |
+ |
|
1055 |
+void uploadMat4ToShader(GLuint shader, char *nameInShader, mat4 m) |
|
1056 |
+{ |
|
1057 |
+ if (nameInShader == NULL) return; |
|
1058 |
+ glUseProgram(shader); |
|
1059 |
+ GLint loc = glGetUniformLocation(shader, nameInShader); |
|
1060 |
+ if (loc >= 0) |
|
1061 |
+ glUniformMatrix4fv(loc, 1, GL_TRUE, m.m); |
|
1062 |
+ else |
|
1063 |
+ ReportError("uploadMat4ToShader", nameInShader); |
|
1064 |
+} |
|
1065 |
+ |
|
1066 |
+void uploadUniformIntToShader(GLuint shader, char *nameInShader, GLint i) |
|
1067 |
+{ |
|
1068 |
+ if (nameInShader == NULL) return; |
|
1069 |
+ glUseProgram(shader); |
|
1070 |
+ GLint loc = glGetUniformLocation(shader, nameInShader); |
|
1071 |
+ if (loc >= 0) |
|
1072 |
+ glUniform1i(loc, i); |
|
1073 |
+ else |
|
1074 |
+ ReportError("uploadUniformIntToShader", nameInShader); |
|
1075 |
+} |
|
1076 |
+ |
|
1077 |
+void uploadUniformFloatToShader(GLuint shader, char *nameInShader, GLfloat f) |
|
1078 |
+{ |
|
1079 |
+ if (nameInShader == NULL) return; |
|
1080 |
+ glUseProgram(shader); |
|
1081 |
+ GLint loc = glGetUniformLocation(shader, nameInShader); |
|
1082 |
+ if (loc >= 0) |
|
1083 |
+ glUniform1f(loc, f); |
|
1084 |
+ else |
|
1085 |
+ ReportError("uploadUniformFloatToShader", nameInShader); |
|
1086 |
+} |
|
1087 |
+ |
|
1088 |
+void uploadUniformFloatArrayToShader(GLuint shader, char *nameInShader, GLfloat *f, int arrayLength) |
|
1089 |
+{ |
|
1090 |
+ if (nameInShader == NULL) return; |
|
1091 |
+ glUseProgram(shader); |
|
1092 |
+ GLint loc = glGetUniformLocation(shader, nameInShader); |
|
1093 |
+ if (loc >= 0) |
|
1094 |
+ glUniform1fv(loc, arrayLength, f); |
|
1095 |
+ else |
|
1096 |
+ ReportError("uploadUniformFloatToShader", nameInShader); |
|
1097 |
+} |
|
1098 |
+ |
|
1099 |
+void uploadUniformVec3ToShader(GLuint shader, char *nameInShader, vec3 v) |
|
1100 |
+{ |
|
1101 |
+ if (nameInShader == NULL) return; |
|
1102 |
+ glUseProgram(shader); |
|
1103 |
+ GLint loc = glGetUniformLocation(shader, nameInShader); |
|
1104 |
+ if (loc >= 0) |
|
1105 |
+ glUniform3f(loc, v.x, v.y, v.z); |
|
1106 |
+ else |
|
1107 |
+ ReportError("uploadUniformVec3ToShader", nameInShader); |
|
1108 |
+} |
|
1109 |
+ |
|
1110 |
+void uploadUniformVec3ArrayToShader(GLuint shader, char *nameInShader, vec3 *a, int arrayLength) |
|
1111 |
+{ |
|
1112 |
+ if (nameInShader == NULL) return; |
|
1113 |
+ glUseProgram(shader); |
|
1114 |
+ GLint loc = glGetUniformLocation(shader, nameInShader); |
|
1115 |
+ if (loc >= 0) |
|
1116 |
+ glUniform3fv(loc, arrayLength, (GLfloat *)a); |
|
1117 |
+ else |
|
1118 |
+ ReportError("uploadUniformVec3ArrayToShader", nameInShader); |
|
1119 |
+} |
|
1120 |
+ |
|
1121 |
+void bindTextureToTextureUnit(GLuint tex, int unit) |
|
1122 |
+{ |
|
1123 |
+ glActiveTexture(GL_TEXTURE0 + unit); |
|
1124 |
+ glBindTexture(GL_TEXTURE_2D, tex); |
|
1125 |
+} |
... | ... |
@@ -142,7 +142,7 @@ extern "C" { |
142 | 142 |
vec3 MultMat3Vec3(mat3 a, vec3 b); // result = a * b |
143 | 143 |
|
144 | 144 |
void OrthoNormalizeMatrix(mat4 *R); |
145 |
- mat4 Transpose(mat4 m); |
|
145 |
+ mat4 transpose(mat4 m); |
|
146 | 146 |
// mat4 TransposeRotation(mat4 m); // Will probably be removed |
147 | 147 |
mat3 TransposeMat3(mat3 m); |
148 | 148 |
mat4 ArbRotate(vec3 axis, GLfloat fi); |
... | ... |
@@ -179,6 +179,15 @@ extern "C" { |
179 | 179 |
void printMat4(mat4 m); |
180 | 180 |
void printVec3(vec3 in); |
181 | 181 |
|
182 |
+/* Utility functions for easier uploads to shaders with error messages. */ |
|
183 |
+// NEW as prototype 2022, added to VU 2023 |
|
184 |
+ void uploadMat4ToShader(GLuint shader, char *nameInShader, mat4 m); |
|
185 |
+ void uploadUniformIntToShader(GLuint shader, char *nameInShader, GLint i); |
|
186 |
+ void uploadUniformFloatToShader(GLuint shader, char *nameInShader, GLfloat f); |
|
187 |
+ void uploadUniformFloatArrayToShader(GLuint shader, char *nameInShader, GLfloat *f, int arrayLength); |
|
188 |
+ void uploadUniformVec3ToShader(GLuint shader, char *nameInShader, vec3 v); |
|
189 |
+ void uploadUniformVec3ArrayToShader(GLuint shader, char *nameInShader, vec3 *a, int arrayLength); |
|
190 |
+ void bindTextureToTextureUnit(GLuint tex, int unit); |
|
182 | 191 |
|
183 | 192 |
|
184 | 193 |
|
207 | 216 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,26 @@ |
1 |
+Daylight box fetched from https://opengameart.org/content/sky-box-sunny-day |
|
2 |
+Copyright/Attribution Notice: |
|
3 |
+KIIRA |
|
4 |
+ |
|
5 |
+cloud-landscape.tga was originally called |
|
6 |
+"png-transparent-skybox-cube-mapping-texture-mapping-terragen-textured-box-photography-cloud-landscape.png" |
|
7 |
+and was fetched from https://www.pngwing.com/en/free-png-ysvvj#google_vignette |
|
8 |
+No source/copyright documented on page. |
|
9 |
+ |
|
10 |
+https://www.pngwing.com/en/free-png-kyycs |
|
11 |
+png-transparent-skybox-texture-mapping-panorama-others-texture-atmosphere-cloud.png |
|
12 |
+Free for non-commercial use. |
|
13 |
+ |
|
14 |
+Desert skybox texture |
|
15 |
+<a href="https://www.nicepng.com/ourpic/u2q8o0t4i1w7q8y3_desert-skybox-texture-png/" target="_blank">Desert - Skybox Texture Png @nicepng.com</a> |
|
16 |
+Original name: 153-1530454_desert-skybox-texture-png.png |
|
17 |
+No source/copyright documented on page. |
|
18 |
+ |
|
19 |
+ |
|
20 |
+Http-skybox texture |
|
21 |
+https://www.nicepng.com/maxp/u2q8y3a9t4r5i1q8/ |
|
22 |
+<a href="https://www.nicepng.com/ourpic/u2q8y3a9t4r5i1q8_http-skybox-texture/" target="_blank">Http - Skybox Texture @nicepng.com</a> |
|
23 |
+"A high-quality creative community needs everyone's contribution. The shared material of Http - Skybox Texture is a free 3611x2693 PNG picture with no background, This PNG image is high resolution and very popular on the public internet. You can download it for free and use it for personal non-commercial use. Http - Skybox Texture belongs to the category watercolor texture png,texture png,grunge texture png. " |
|
24 |
+-> personal non-commercial use |
|
25 |
+Original name "96-961924_http-skybox-texture.png" |
|
26 |
+ |
6 | 33 |
new file mode 100755 |
... | ... |
@@ -0,0 +1,51 @@ |
1 |
+# Full skybox |
|
2 |
+ |
|
3 |
+# Built manually by Ingemar |
|
4 |
+# This version has tweaked number to get inside the borders |
|
5 |
+# and avoid interpolation with the empty areas |
|
6 |
+ |
|
7 |
+mtllib cube.mtl |
|
8 |
+o cube1 |
|
9 |
+#8 vertices, 5 faces |
|
10 |
+v -2.0 -2.0 2.0 |
|
11 |
+v -2.0 2.0 2.0 |
|
12 |
+v 2.0 2.0 2.0 |
|
13 |
+v 2.0 -2.0 2.0 |
|
14 |
+v -2.0 -2.0 -2.0 |
|
15 |
+v -2.0 2.0 -2.0 |
|
16 |
+v 2.0 2.0 -2.0 |
|
17 |
+v 2.0 -2.0 -2.0 |
|
18 |
+ |
|
19 |
+vt 0.252 1.0 |
|
20 |
+vt 0.498 1.0 |
|
21 |
+ |
|
22 |
+vt 0.0 0.665 |
|
23 |
+vt 0.252 0.665 |
|
24 |
+vt 0.498 0.665 |
|
25 |
+vt 0.75 0.665 |
|
26 |
+vt 1.0 0.665 |
|
27 |
+ |
|
28 |
+vt 0.0 0.34 |
|
29 |
+vt 0.252 0.34 |
|
30 |
+vt 0.498 0.34 |
|
31 |
+vt 0.75 0.34 |
|
32 |
+vt 1.0 0.34 |
|
33 |
+ |
|
34 |
+vt 0.252 0.0 |
|
35 |
+vt 0.498 0.0 |
|
36 |
+ |
|
37 |
+g cube1_default |
|
38 |
+usemtl default |
|
39 |
+# top |
|
40 |
+f 2/4 6/1 7/2 3/5 |
|
41 |
+# front |
|
42 |
+f 1/9 2/4 3/5 4/10 |
|
43 |
+# right |
|
44 |
+f 3/5 7/6 8/11 4/10 |
|
45 |
+# back |
|
46 |
+f 8/11 7/6 6/7 5/12 |
|
47 |
+# left |
|
48 |
+f 5/8 6/3 2/4 1/9 |
|
49 |
+# bottom |
|
50 |
+f 1/9 4/10 8/14 5/13 |
|
51 |
+ |
0 | 52 |
new file mode 100755 |
... | ... |
@@ -0,0 +1,49 @@ |
1 |
+# Full skybox |
|
2 |
+ |
|
3 |
+# Built manually by Ingemar |
|
4 |
+ |
|
5 |
+mtllib cube.mtl |
|
6 |
+o cube1 |
|
7 |
+#8 vertices, 5 faces |
|
8 |
+v -2.0 -2.0 2.0 |
|
9 |
+v -2.0 2.0 2.0 |
|
10 |
+v 2.0 2.0 2.0 |
|
11 |
+v 2.0 -2.0 2.0 |
|
12 |
+v -2.0 -2.0 -2.0 |
|
13 |
+v -2.0 2.0 -2.0 |
|
14 |
+v 2.0 2.0 -2.0 |
|
15 |
+v 2.0 -2.0 -2.0 |
|
16 |
+ |
|
17 |
+vt 0.25 1.0 |
|
18 |
+vt 0.5 1.0 |
|
19 |
+ |
|
20 |
+vt 0.0 0.67 |
|
21 |
+vt 0.25 0.67 |
|
22 |
+vt 0.5 0.67 |
|
23 |
+vt 0.75 0.67 |
|
24 |
+vt 1.0 0.67 |
|
25 |
+ |
|
26 |
+vt 0.0 0.33 |
|
27 |
+vt 0.25 0.33 |
|
28 |
+vt 0.5 0.33 |
|
29 |
+vt 0.75 0.33 |
|
30 |
+vt 1.0 0.33 |
|
31 |
+ |
|
32 |
+vt 0.25 0.0 |
|
33 |
+vt 0.5 0.0 |
|
34 |
+ |
|
35 |
+g cube1_default |
|
36 |
+usemtl default |
|
37 |
+# top |
|
38 |
+f 2/4 6/1 7/2 3/5 |
|
39 |
+# front |
|
40 |
+f 1/9 2/4 3/5 4/10 |
|
41 |
+# right |
|
42 |
+f 3/5 7/6 8/11 4/10 |
|
43 |
+# back |
|
44 |
+f 8/11 7/6 6/7 5/12 |
|
45 |
+# left |
|
46 |
+f 5/8 6/3 2/4 1/9 |
|
47 |
+# bottom |
|
48 |
+f 1/9 4/10 8/14 5/13 |
|
49 |
+ |
6 | 56 |
new file mode 100755 |
... | ... |
@@ -0,0 +1,39 @@ |
1 |
+# Exported from Wings 3D 0.98.26b |
|
2 |
+# Edited by Ingemar, extended to full height |
|
3 |
+# No normal vector - this is a skybox! |
|
4 |
+ |
|
5 |
+mtllib cube.mtl |
|
6 |
+o cube1 |
|
7 |
+#8 vertices, 5 faces |
|
8 |
+v -2.0 -2.0 2.0 |
|
9 |
+v -2.0 2.0 2.0 |
|
10 |
+v 2.0 2.0 2.0 |
|
11 |
+v 2.0 -2.0 2.0 |
|
12 |
+v -2.0 -2.0 -2.0 |
|
13 |
+v -2.0 2.0 -2.0 |
|
14 |
+v 2.0 2.0 -2.0 |
|
15 |
+v 2.0 -2.0 -2.0 |
|
16 |
+ |
|
17 |
+vt 0.33 0.0 |
|
18 |
+vt 0.67 0.0 |
|
19 |
+ |
|
20 |
+vt 0.0 0.33 |
|
21 |
+vt 0.33 0.33 |
|
22 |
+vt 0.67 0.33 |
|
23 |
+vt 1.0 0.33 |
|
24 |
+ |
|
25 |
+vt 0.0 0.67 |
|
26 |
+vt 0.33 0.67 |
|
27 |
+vt 0.67 0.67 |
|
28 |
+vt 1.0 0.67 |
|
29 |
+ |
|
30 |
+vt 0.33 1.0 |
|
31 |
+vt 0.67 1.0 |
|
32 |
+ |
|
33 |
+g cube1_default |
|
34 |
+usemtl default |
|
35 |
+f 3/9 2/8 1/11/1 4/12 |
|
36 |
+f 5/3 1/7 2/8/2 6/4 |
|
37 |
+f 6/4 2/8 3/9/3 7/5 |
|
38 |
+f 7/5 3/9 4/10/4 8/6 |
|
39 |
+f 8/2 5/1 6/4/6 7/5 |