minor tweaks ...
This commit is contained in:
parent
a3bb4bc122
commit
6ec192a890
3 changed files with 27 additions and 16 deletions
|
@ -1 +1,3 @@
|
|||
triload.o: triload.c triload.h
|
||||
tri2obj.o: tri2obj.c tri2obj.h ../../Src/constants.h ../../Src/types.h \
|
||||
../../Src/Math/fg_geodesy.h ../../Src/Math/mat3.h \
|
||||
../../Src/Math/polar.h ../../Src/Math/../types.h
|
||||
|
|
|
@ -135,10 +135,10 @@ void triload(char *basename) {
|
|||
for ( i = 1; i <= nodecount; i++ ) {
|
||||
fscanf(node, "%d %lf %lf %lf %d\n", &junk1,
|
||||
&n[0], &n[1], &n[2], &junk2);
|
||||
printf("%d %.2f %.2f %.2f\n", junk1, n[0], n[1], n[2]);
|
||||
/* printf("%d %.2f %.2f %.2f\n", junk1, n[0], n[1], n[2]); */
|
||||
nodes[i] = geod_to_cart(n);
|
||||
printf("%d %.2f %.2f %.2f\n",
|
||||
junk1, nodes[i].x, nodes[i].y, nodes[i].z);
|
||||
/* printf("%d %.2f %.2f %.2f\n",
|
||||
junk1, nodes[i].x, nodes[i].y, nodes[i].z); */
|
||||
}
|
||||
|
||||
fclose(node);
|
||||
|
@ -183,11 +183,13 @@ void dump_obj(char *basename) {
|
|||
obj = fopen(objname, "w");
|
||||
|
||||
/* dump vertices */
|
||||
printf(" writing vertices\n");
|
||||
for ( i = 1; i <= nodecount; i++ ) {
|
||||
fprintf(obj, "v %.2f %.2f %.2f\n",
|
||||
nodes[i].x, nodes[i].y, nodes[i].z);
|
||||
}
|
||||
|
||||
printf(" calculating and writing normals\n");
|
||||
/* calculate and generate normals */
|
||||
for ( i = 1; i <= nodecount; i++ ) {
|
||||
find_tris(i, &t1, &t2, &t3);
|
||||
|
@ -219,6 +221,7 @@ void dump_obj(char *basename) {
|
|||
}
|
||||
|
||||
/* dump faces */
|
||||
printf(" writing faces\n");
|
||||
for ( i = 1; i <= tricount; i++ ) {
|
||||
fprintf(obj, "f %d//%d %d//%d %d//%d\n",
|
||||
tris[i][0], tris[i][0],
|
||||
|
@ -245,12 +248,15 @@ int main(int argc, char **argv) {
|
|||
|
||||
|
||||
/* $Log$
|
||||
/* Revision 1.2 1997/11/14 00:29:13 curt
|
||||
/* Transform scenery coordinates at this point in pipeline when scenery is
|
||||
/* being translated to .obj format, not when it is being loaded into the end
|
||||
/* renderer. Precalculate normals for each node as average of the normals
|
||||
/* of each containing polygon so Garoude shading is now supportable.
|
||||
/* Revision 1.3 1997/11/15 18:05:05 curt
|
||||
/* minor tweaks ...
|
||||
/*
|
||||
* Revision 1.2 1997/11/14 00:29:13 curt
|
||||
* Transform scenery coordinates at this point in pipeline when scenery is
|
||||
* being translated to .obj format, not when it is being loaded into the end
|
||||
* renderer. Precalculate normals for each node as average of the normals
|
||||
* of each containing polygon so Garoude shading is now supportable.
|
||||
*
|
||||
* Revision 1.1 1997/10/29 23:05:15 curt
|
||||
* Initial revision.
|
||||
*
|
||||
|
|
|
@ -32,8 +32,8 @@
|
|||
#include <string.h>
|
||||
|
||||
|
||||
#define MAX_NODES 100000
|
||||
#define MAX_TRIS 200000
|
||||
#define MAX_NODES 200000
|
||||
#define MAX_TRIS 400000
|
||||
|
||||
|
||||
extern int nodecount, tricount;
|
||||
|
@ -50,12 +50,15 @@ void triload(char *basename);
|
|||
|
||||
|
||||
/* $Log$
|
||||
/* Revision 1.2 1997/11/14 00:29:13 curt
|
||||
/* Transform scenery coordinates at this point in pipeline when scenery is
|
||||
/* being translated to .obj format, not when it is being loaded into the end
|
||||
/* renderer. Precalculate normals for each node as average of the normals
|
||||
/* of each containing polygon so Garoude shading is now supportable.
|
||||
/* Revision 1.3 1997/11/15 18:05:06 curt
|
||||
/* minor tweaks ...
|
||||
/*
|
||||
* Revision 1.2 1997/11/14 00:29:13 curt
|
||||
* Transform scenery coordinates at this point in pipeline when scenery is
|
||||
* being translated to .obj format, not when it is being loaded into the end
|
||||
* renderer. Precalculate normals for each node as average of the normals
|
||||
* of each containing polygon so Garoude shading is now supportable.
|
||||
*
|
||||
* Revision 1.1 1997/10/29 23:05:15 curt
|
||||
* Initial revision.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue