Lots of updates to get back in sync with changes made over in .../Src/
This commit is contained in:
parent
91d6c58aec
commit
f389ae86de
6 changed files with 225 additions and 204 deletions
|
@ -31,12 +31,12 @@
|
||||||
|
|
||||||
#include "assemtris.h"
|
#include "assemtris.h"
|
||||||
|
|
||||||
#include "../../Src/Include/constants.h"
|
#include <Include/fg_constants.h>
|
||||||
#include "../../Src/Include/types.h"
|
#include <Include/fg_types.h>
|
||||||
#include "../../Src/Math/fg_geodesy.h"
|
#include <Math/fg_geodesy.h>
|
||||||
#include "../../Src/Math/mat3.h"
|
#include <Math/mat3.h>
|
||||||
#include "../../Src/Math/polar.h"
|
#include <Math/polar.h>
|
||||||
#include "../../Src/Scenery/tileutils.h"
|
#include <Scenery/bucketutils.h>
|
||||||
|
|
||||||
|
|
||||||
int nodecount = 0;
|
int nodecount = 0;
|
||||||
|
@ -44,9 +44,9 @@ int nodecount = 0;
|
||||||
float nodes[MAX_NODES][3];
|
float nodes[MAX_NODES][3];
|
||||||
|
|
||||||
|
|
||||||
struct bucket my_index;
|
struct fgBUCKET my_index;
|
||||||
struct bucket ne_index, nw_index, sw_index, se_index;
|
struct fgBUCKET ne_index, nw_index, sw_index, se_index;
|
||||||
struct bucket north_index, south_index, east_index, west_index;
|
struct fgBUCKET north_index, south_index, east_index, west_index;
|
||||||
|
|
||||||
|
|
||||||
/* return the file base name ( foo/bar/file.ext = file.ext ) */
|
/* return the file base name ( foo/bar/file.ext = file.ext ) */
|
||||||
|
@ -108,26 +108,26 @@ int shared_object_exists(char *basepath, char *ext, char *file) {
|
||||||
long int index;
|
long int index;
|
||||||
|
|
||||||
if ( strcmp(ext, ".sw") == 0 ) {
|
if ( strcmp(ext, ".sw") == 0 ) {
|
||||||
gen_base_path(&my_index, scene_path);
|
fgBucketGenBasePath(&my_index, scene_path);
|
||||||
index = gen_index(&my_index);
|
index = fgBucketGenIndex(&my_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.sw", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.sw", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&west_index, scene_path);
|
fgBucketGenBasePath(&west_index, scene_path);
|
||||||
index = gen_index(&west_index);
|
index = fgBucketGenIndex(&west_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.se", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.se", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&sw_index, scene_path);
|
fgBucketGenBasePath(&sw_index, scene_path);
|
||||||
index = gen_index(&sw_index);
|
index = fgBucketGenIndex(&sw_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.ne", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.ne", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&south_index, scene_path);
|
fgBucketGenBasePath(&south_index, scene_path);
|
||||||
index = gen_index(&south_index);
|
index = fgBucketGenIndex(&south_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.nw", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.nw", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
|
@ -135,26 +135,26 @@ int shared_object_exists(char *basepath, char *ext, char *file) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( strcmp(ext, ".se") == 0 ) {
|
if ( strcmp(ext, ".se") == 0 ) {
|
||||||
gen_base_path(&my_index, scene_path);
|
fgBucketGenBasePath(&my_index, scene_path);
|
||||||
index = gen_index(&my_index);
|
index = fgBucketGenIndex(&my_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.se", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.se", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&east_index, scene_path);
|
fgBucketGenBasePath(&east_index, scene_path);
|
||||||
index = gen_index(&east_index);
|
index = fgBucketGenIndex(&east_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.sw", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.sw", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&se_index, scene_path);
|
fgBucketGenBasePath(&se_index, scene_path);
|
||||||
index = gen_index(&se_index);
|
index = fgBucketGenIndex(&se_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.nw", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.nw", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&south_index, scene_path);
|
fgBucketGenBasePath(&south_index, scene_path);
|
||||||
index = gen_index(&south_index);
|
index = fgBucketGenIndex(&south_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.ne", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.ne", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
|
@ -162,26 +162,26 @@ int shared_object_exists(char *basepath, char *ext, char *file) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( strcmp(ext, ".ne") == 0 ) {
|
if ( strcmp(ext, ".ne") == 0 ) {
|
||||||
gen_base_path(&my_index, scene_path);
|
fgBucketGenBasePath(&my_index, scene_path);
|
||||||
index = gen_index(&my_index);
|
index = fgBucketGenIndex(&my_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.ne", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.ne", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&east_index, scene_path);
|
fgBucketGenBasePath(&east_index, scene_path);
|
||||||
index = gen_index(&east_index);
|
index = fgBucketGenIndex(&east_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.nw", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.nw", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&ne_index, scene_path);
|
fgBucketGenBasePath(&ne_index, scene_path);
|
||||||
index = gen_index(&ne_index);
|
index = fgBucketGenIndex(&ne_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.sw", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.sw", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&north_index, scene_path);
|
fgBucketGenBasePath(&north_index, scene_path);
|
||||||
index = gen_index(&north_index);
|
index = fgBucketGenIndex(&north_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.se", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.se", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
|
@ -189,26 +189,26 @@ int shared_object_exists(char *basepath, char *ext, char *file) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( strcmp(ext, ".nw") == 0 ) {
|
if ( strcmp(ext, ".nw") == 0 ) {
|
||||||
gen_base_path(&my_index, scene_path);
|
fgBucketGenBasePath(&my_index, scene_path);
|
||||||
index = gen_index(&my_index);
|
index = fgBucketGenIndex(&my_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.nw", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.nw", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&west_index, scene_path);
|
fgBucketGenBasePath(&west_index, scene_path);
|
||||||
index = gen_index(&west_index);
|
index = fgBucketGenIndex(&west_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.ne", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.ne", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&nw_index, scene_path);
|
fgBucketGenBasePath(&nw_index, scene_path);
|
||||||
index = gen_index(&nw_index);
|
index = fgBucketGenIndex(&nw_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.se", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.se", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&north_index, scene_path);
|
fgBucketGenBasePath(&north_index, scene_path);
|
||||||
index = gen_index(&north_index);
|
index = fgBucketGenIndex(&north_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.sw", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.sw", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
|
@ -216,14 +216,14 @@ int shared_object_exists(char *basepath, char *ext, char *file) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( strcmp(ext, ".south") == 0 ) {
|
if ( strcmp(ext, ".south") == 0 ) {
|
||||||
gen_base_path(&my_index, scene_path);
|
fgBucketGenBasePath(&my_index, scene_path);
|
||||||
index = gen_index(&my_index);
|
index = fgBucketGenIndex(&my_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.south", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.south", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&south_index, scene_path);
|
fgBucketGenBasePath(&south_index, scene_path);
|
||||||
index = gen_index(&south_index);
|
index = fgBucketGenIndex(&south_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.north", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.north", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
|
@ -231,14 +231,14 @@ int shared_object_exists(char *basepath, char *ext, char *file) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( strcmp(ext, ".north") == 0 ) {
|
if ( strcmp(ext, ".north") == 0 ) {
|
||||||
gen_base_path(&my_index, scene_path);
|
fgBucketGenBasePath(&my_index, scene_path);
|
||||||
index = gen_index(&my_index);
|
index = fgBucketGenIndex(&my_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.north", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.north", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&north_index, scene_path);
|
fgBucketGenBasePath(&north_index, scene_path);
|
||||||
index = gen_index(&north_index);
|
index = fgBucketGenIndex(&north_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.south", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.south", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
|
@ -246,14 +246,14 @@ int shared_object_exists(char *basepath, char *ext, char *file) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( strcmp(ext, ".west") == 0 ) {
|
if ( strcmp(ext, ".west") == 0 ) {
|
||||||
gen_base_path(&my_index, scene_path);
|
fgBucketGenBasePath(&my_index, scene_path);
|
||||||
index = gen_index(&my_index);
|
index = fgBucketGenIndex(&my_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.west", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.west", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&west_index, scene_path);
|
fgBucketGenBasePath(&west_index, scene_path);
|
||||||
index = gen_index(&west_index);
|
index = fgBucketGenIndex(&west_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.east", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.east", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
|
@ -261,14 +261,14 @@ int shared_object_exists(char *basepath, char *ext, char *file) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( strcmp(ext, ".east") == 0 ) {
|
if ( strcmp(ext, ".east") == 0 ) {
|
||||||
gen_base_path(&my_index, scene_path);
|
fgBucketGenBasePath(&my_index, scene_path);
|
||||||
index = gen_index(&my_index);
|
index = fgBucketGenIndex(&my_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.east", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.east", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&east_index, scene_path);
|
fgBucketGenBasePath(&east_index, scene_path);
|
||||||
index = gen_index(&east_index);
|
index = fgBucketGenIndex(&east_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.west", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.west", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
|
@ -276,8 +276,8 @@ int shared_object_exists(char *basepath, char *ext, char *file) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( strcmp(ext, ".body") == 0 ) {
|
if ( strcmp(ext, ".body") == 0 ) {
|
||||||
gen_base_path(&my_index, scene_path);
|
fgBucketGenBasePath(&my_index, scene_path);
|
||||||
index = gen_index(&my_index);
|
index = fgBucketGenIndex(&my_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.body", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.body", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
|
@ -421,20 +421,20 @@ int main(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
tmp_index = atoi(temp);
|
tmp_index = atoi(temp);
|
||||||
printf("%ld\n", tmp_index);
|
printf("%ld\n", tmp_index);
|
||||||
parse_index(tmp_index, &my_index);
|
fgBucketParseIndex(tmp_index, &my_index);
|
||||||
|
|
||||||
printf("bucket = %d %d %d %d\n",
|
printf("bucket = %d %d %d %d\n",
|
||||||
my_index.lon, my_index.lat, my_index.x, my_index.y);
|
my_index.lon, my_index.lat, my_index.x, my_index.y);
|
||||||
/* generate the indexes of the neighbors */
|
/* generate the indexes of the neighbors */
|
||||||
offset_bucket(&my_index, &ne_index, 1, 1);
|
fgBucketOffset(&my_index, &ne_index, 1, 1);
|
||||||
offset_bucket(&my_index, &nw_index, -1, 1);
|
fgBucketOffset(&my_index, &nw_index, -1, 1);
|
||||||
offset_bucket(&my_index, &se_index, 1, -1);
|
fgBucketOffset(&my_index, &se_index, 1, -1);
|
||||||
offset_bucket(&my_index, &sw_index, -1, -1);
|
fgBucketOffset(&my_index, &sw_index, -1, -1);
|
||||||
|
|
||||||
offset_bucket(&my_index, &north_index, 0, 1);
|
fgBucketOffset(&my_index, &north_index, 0, 1);
|
||||||
offset_bucket(&my_index, &south_index, 0, -1);
|
fgBucketOffset(&my_index, &south_index, 0, -1);
|
||||||
offset_bucket(&my_index, &east_index, 1, 0);
|
fgBucketOffset(&my_index, &east_index, 1, 0);
|
||||||
offset_bucket(&my_index, &west_index, -1, 0);
|
fgBucketOffset(&my_index, &west_index, -1, 0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
printf("Corner indexes = %ld %ld %ld %ld\n",
|
printf("Corner indexes = %ld %ld %ld %ld\n",
|
||||||
|
@ -454,11 +454,14 @@ int main(int argc, char **argv) {
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.2 1998/01/15 21:33:36 curt
|
/* Revision 1.3 1998/01/27 18:37:00 curt
|
||||||
/* Assembling triangles and building a new .node file with the proper shared
|
/* Lots of updates to get back in sync with changes made over in .../Src/
|
||||||
/* vertices now works. Now we just have to use the shared normals and we'll
|
|
||||||
/* be all set.
|
|
||||||
/*
|
/*
|
||||||
|
* Revision 1.2 1998/01/15 21:33:36 curt
|
||||||
|
* Assembling triangles and building a new .node file with the proper shared
|
||||||
|
* vertices now works. Now we just have to use the shared normals and we'll
|
||||||
|
* be all set.
|
||||||
|
*
|
||||||
* Revision 1.1 1998/01/15 02:45:26 curt
|
* Revision 1.1 1998/01/15 02:45:26 curt
|
||||||
* Initial revision.
|
* Initial revision.
|
||||||
*
|
*
|
||||||
|
|
|
@ -34,12 +34,12 @@
|
||||||
|
|
||||||
#include "splittris.h"
|
#include "splittris.h"
|
||||||
|
|
||||||
#include "../../Src/Include/constants.h"
|
#include <Include/fg_constants.h>
|
||||||
#include "../../Src/Include/types.h"
|
#include <Include/fg_types.h>
|
||||||
#include "../../Src/Math/fg_geodesy.h"
|
#include <Math/fg_geodesy.h>
|
||||||
#include "../../Src/Math/mat3.h"
|
#include <Math/mat3.h>
|
||||||
#include "../../Src/Math/polar.h"
|
#include <Math/polar.h>
|
||||||
#include "../../Src/Scenery/tileutils.h"
|
#include <Scenery/bucketutils.h>
|
||||||
|
|
||||||
|
|
||||||
int nodecount, tricount;
|
int nodecount, tricount;
|
||||||
|
@ -51,8 +51,8 @@ int new_tris[MAX_TRIS][3];
|
||||||
|
|
||||||
struct fgCartesianPoint nodes_cart[MAX_NODES];
|
struct fgCartesianPoint nodes_cart[MAX_NODES];
|
||||||
|
|
||||||
struct bucket ne_index, nw_index, sw_index, se_index;
|
struct fgBUCKET ne_index, nw_index, sw_index, se_index;
|
||||||
struct bucket north_index, south_index, east_index, west_index;
|
struct fgBUCKET north_index, south_index, east_index, west_index;
|
||||||
|
|
||||||
/* convert a geodetic point lon(arcsec), lat(arcsec), elev(meter) to
|
/* convert a geodetic point lon(arcsec), lat(arcsec), elev(meter) to
|
||||||
* a cartesian point */
|
* a cartesian point */
|
||||||
|
@ -260,20 +260,20 @@ int shared_object_exists(char *basepath, char *ext) {
|
||||||
long int index;
|
long int index;
|
||||||
|
|
||||||
if ( strcmp(ext, ".sw") == 0 ) {
|
if ( strcmp(ext, ".sw") == 0 ) {
|
||||||
gen_base_path(&west_index, scene_path);
|
fgBucketGenBasePath(&west_index, scene_path);
|
||||||
index = gen_index(&west_index);
|
index = fgBucketGenIndex(&west_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.se", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.se", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&sw_index, scene_path);
|
fgBucketGenBasePath(&sw_index, scene_path);
|
||||||
index = gen_index(&sw_index);
|
index = fgBucketGenIndex(&sw_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.ne", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.ne", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&south_index, scene_path);
|
fgBucketGenBasePath(&south_index, scene_path);
|
||||||
index = gen_index(&south_index);
|
index = fgBucketGenIndex(&south_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.nw", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.nw", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
|
@ -281,20 +281,20 @@ int shared_object_exists(char *basepath, char *ext) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( strcmp(ext, ".se") == 0 ) {
|
if ( strcmp(ext, ".se") == 0 ) {
|
||||||
gen_base_path(&east_index, scene_path);
|
fgBucketGenBasePath(&east_index, scene_path);
|
||||||
index = gen_index(&east_index);
|
index = fgBucketGenIndex(&east_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.sw", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.sw", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&se_index, scene_path);
|
fgBucketGenBasePath(&se_index, scene_path);
|
||||||
index = gen_index(&se_index);
|
index = fgBucketGenIndex(&se_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.nw", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.nw", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&south_index, scene_path);
|
fgBucketGenBasePath(&south_index, scene_path);
|
||||||
index = gen_index(&south_index);
|
index = fgBucketGenIndex(&south_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.ne", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.ne", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
|
@ -302,20 +302,20 @@ int shared_object_exists(char *basepath, char *ext) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( strcmp(ext, ".ne") == 0 ) {
|
if ( strcmp(ext, ".ne") == 0 ) {
|
||||||
gen_base_path(&east_index, scene_path);
|
fgBucketGenBasePath(&east_index, scene_path);
|
||||||
index = gen_index(&east_index);
|
index = fgBucketGenIndex(&east_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.nw", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.nw", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&ne_index, scene_path);
|
fgBucketGenBasePath(&ne_index, scene_path);
|
||||||
index = gen_index(&ne_index);
|
index = fgBucketGenIndex(&ne_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.sw", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.sw", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&north_index, scene_path);
|
fgBucketGenBasePath(&north_index, scene_path);
|
||||||
index = gen_index(&north_index);
|
index = fgBucketGenIndex(&north_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.se", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.se", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
|
@ -323,20 +323,20 @@ int shared_object_exists(char *basepath, char *ext) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( strcmp(ext, ".nw") == 0 ) {
|
if ( strcmp(ext, ".nw") == 0 ) {
|
||||||
gen_base_path(&west_index, scene_path);
|
fgBucketGenBasePath(&west_index, scene_path);
|
||||||
index = gen_index(&west_index);
|
index = fgBucketGenIndex(&west_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.ne", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.ne", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&nw_index, scene_path);
|
fgBucketGenBasePath(&nw_index, scene_path);
|
||||||
index = gen_index(&nw_index);
|
index = fgBucketGenIndex(&nw_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.se", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.se", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&north_index, scene_path);
|
fgBucketGenBasePath(&north_index, scene_path);
|
||||||
index = gen_index(&north_index);
|
index = fgBucketGenIndex(&north_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.sw", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.sw", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
|
@ -344,8 +344,8 @@ int shared_object_exists(char *basepath, char *ext) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( strcmp(ext, ".south") == 0 ) {
|
if ( strcmp(ext, ".south") == 0 ) {
|
||||||
gen_base_path(&south_index, scene_path);
|
fgBucketGenBasePath(&south_index, scene_path);
|
||||||
index = gen_index(&south_index);
|
index = fgBucketGenIndex(&south_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.north", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.north", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
|
@ -353,8 +353,8 @@ int shared_object_exists(char *basepath, char *ext) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( strcmp(ext, ".north") == 0 ) {
|
if ( strcmp(ext, ".north") == 0 ) {
|
||||||
gen_base_path(&north_index, scene_path);
|
fgBucketGenBasePath(&north_index, scene_path);
|
||||||
index = gen_index(&north_index);
|
index = fgBucketGenIndex(&north_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.south", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.south", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
|
@ -362,8 +362,8 @@ int shared_object_exists(char *basepath, char *ext) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( strcmp(ext, ".west") == 0 ) {
|
if ( strcmp(ext, ".west") == 0 ) {
|
||||||
gen_base_path(&west_index, scene_path);
|
fgBucketGenBasePath(&west_index, scene_path);
|
||||||
index = gen_index(&west_index);
|
index = fgBucketGenIndex(&west_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.east", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.east", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
|
@ -371,8 +371,8 @@ int shared_object_exists(char *basepath, char *ext) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( strcmp(ext, ".east") == 0 ) {
|
if ( strcmp(ext, ".east") == 0 ) {
|
||||||
gen_base_path(&east_index, scene_path);
|
fgBucketGenBasePath(&east_index, scene_path);
|
||||||
index = gen_index(&east_index);
|
index = fgBucketGenIndex(&east_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.west", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.west", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
|
@ -557,7 +557,7 @@ void dump_obj(char *basename, char *basepath) {
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
char basename[256], basepath[256], temp[256];
|
char basename[256], basepath[256], temp[256];
|
||||||
struct bucket p;
|
struct fgBUCKET p;
|
||||||
long int index;
|
long int index;
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
|
@ -577,19 +577,19 @@ int main(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
index = atoi(temp);
|
index = atoi(temp);
|
||||||
printf("%ld\n", index);
|
printf("%ld\n", index);
|
||||||
parse_index(index, &p);
|
fgBucketParseIndex(index, &p);
|
||||||
|
|
||||||
printf("bucket = %d %d %d %d\n", p.lon, p.lat, p.x, p.y);
|
printf("bucket = %d %d %d %d\n", p.lon, p.lat, p.x, p.y);
|
||||||
/* generate the indexes of the neighbors */
|
/* generate the indexes of the neighbors */
|
||||||
offset_bucket(&p, &ne_index, 1, 1);
|
fgBucketOffset(&p, &ne_index, 1, 1);
|
||||||
offset_bucket(&p, &nw_index, -1, 1);
|
fgBucketOffset(&p, &nw_index, -1, 1);
|
||||||
offset_bucket(&p, &se_index, 1, -1);
|
fgBucketOffset(&p, &se_index, 1, -1);
|
||||||
offset_bucket(&p, &sw_index, -1, -1);
|
fgBucketOffset(&p, &sw_index, -1, -1);
|
||||||
|
|
||||||
offset_bucket(&p, &north_index, 0, 1);
|
fgBucketOffset(&p, &north_index, 0, 1);
|
||||||
offset_bucket(&p, &south_index, 0, -1);
|
fgBucketOffset(&p, &south_index, 0, -1);
|
||||||
offset_bucket(&p, &east_index, 1, 0);
|
fgBucketOffset(&p, &east_index, 1, 0);
|
||||||
offset_bucket(&p, &west_index, -1, 0);
|
fgBucketOffset(&p, &west_index, -1, 0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
printf("Corner indexes = %ld %ld %ld %ld\n",
|
printf("Corner indexes = %ld %ld %ld %ld\n",
|
||||||
|
@ -609,9 +609,12 @@ int main(int argc, char **argv) {
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.2 1998/01/14 15:54:43 curt
|
/* Revision 1.3 1998/01/27 18:37:04 curt
|
||||||
/* Initial revision completed.
|
/* Lots of updates to get back in sync with changes made over in .../Src/
|
||||||
/*
|
/*
|
||||||
|
* Revision 1.2 1998/01/14 15:54:43 curt
|
||||||
|
* Initial revision completed.
|
||||||
|
*
|
||||||
* Revision 1.1 1998/01/14 02:11:31 curt
|
* Revision 1.1 1998/01/14 02:11:31 curt
|
||||||
* Initial revision.
|
* Initial revision.
|
||||||
*
|
*
|
||||||
|
|
|
@ -59,15 +59,15 @@ clean:
|
||||||
|
|
||||||
source-tar: clean
|
source-tar: clean
|
||||||
(cd ..; \
|
(cd ..; \
|
||||||
tar cvzf demtools-$(VERSION).tar.gz Tools/Makefile Tools/README \
|
tar cvzf demtools-$(FG_VERSION).tar.gz Tools/Makefile Tools/README \
|
||||||
Tools/TODO Tools/make.inc Tools/AssemTris Tools/Dem2node \
|
Tools/Todo Tools/make.inc Tools/AssemTris Tools/Dem2node \
|
||||||
Tools/FixNode Tools/FixObj Tools/SplitTris Tools/Stripe_u \
|
Tools/FixNode Tools/FixObj Tools/SplitTris Tools/Stripe_u \
|
||||||
Tools/Tri2obj Tools/Triangle)
|
Tools/Tri2obj Tools/Triangle)
|
||||||
|
|
||||||
source-zip: clean
|
source-zip: clean
|
||||||
(cd ..; \
|
(cd ..; \
|
||||||
zip -r demtools-$(VERSION).zip Tools/Makefile Tools/README \
|
zip -r demtools-$(FG_VERSION).zip Tools/Makefile Tools/README \
|
||||||
Tools/TODO Tools/make.inc Tools/AssemTris Tools/Dem2node \
|
Tools/Todo Tools/make.inc Tools/AssemTris Tools/Dem2node \
|
||||||
Tools/FixNode Tools/FixObj Tools/SplitTris Tools/Stripe_u \
|
Tools/FixNode Tools/FixObj Tools/SplitTris Tools/Stripe_u \
|
||||||
Tools/Tri2obj Tools/Triangle)
|
Tools/Tri2obj Tools/Triangle)
|
||||||
|
|
||||||
|
@ -75,20 +75,23 @@ bin-tar: all
|
||||||
echo "need to fix this"
|
echo "need to fix this"
|
||||||
# cp GLUT/fg0 GLUT/runfg ..
|
# cp GLUT/fg0 GLUT/runfg ..
|
||||||
# (cd ../..; \
|
# (cd ../..; \
|
||||||
# tar cvzf bin-$(VERSION).tar.gz FlightGear/fgtop FlightGear/fg0 \
|
# tar cvzf bin-$(FG_VERSION).tar.gz FlightGear/fgtop FlightGear/fg0 \
|
||||||
# FlightGear/runfg FlightGear/COPYING FlightGear/Docs FlightGear/Thanks)
|
# FlightGear/runfg FlightGear/COPYING FlightGear/Docs FlightGear/Thanks)
|
||||||
|
|
||||||
bin-zip:
|
bin-zip:
|
||||||
echo "need to fix this"
|
echo "need to fix this"
|
||||||
# cp GLUT/fg0.exe GLUT/runfg.bat GLUT/cygwin.dll ..
|
# cp GLUT/fg0.exe GLUT/runfg.bat GLUT/cygwin.dll ..
|
||||||
# (cd ../..; \
|
# (cd ../..; \
|
||||||
# zip -r bin-$(VERSION).zip FlightGear/fgtop FlightGear/fg0.exe \
|
# zip -r bin-$(FG_VERSION).zip FlightGear/fgtop FlightGear/fg0.exe \
|
||||||
# FlightGear/runfg.bat FlightGear/cygwin.dll FlightGear/COPYING \
|
# FlightGear/runfg.bat FlightGear/cygwin.dll FlightGear/COPYING \
|
||||||
# FlightGear/Docs FlightGear/Thanks)
|
# FlightGear/Docs FlightGear/Thanks)
|
||||||
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# $Log$
|
# $Log$
|
||||||
|
# Revision 1.7 1998/01/27 18:36:53 curt
|
||||||
|
# Lots of updates to get back in sync with changes made over in .../Src/
|
||||||
|
#
|
||||||
# Revision 1.6 1998/01/21 02:55:42 curt
|
# Revision 1.6 1998/01/21 02:55:42 curt
|
||||||
# Incorporated new make system from Bob Kuehne <rpk@sgi.com>.
|
# Incorporated new make system from Bob Kuehne <rpk@sgi.com>.
|
||||||
#
|
#
|
||||||
|
|
11
Tools/Todo
11
Tools/Todo
|
@ -9,15 +9,20 @@
|
||||||
1/14/98 - Reassemble triangles using only body, shared corners, and
|
1/14/98 - Reassemble triangles using only body, shared corners, and
|
||||||
shared edges.
|
shared edges.
|
||||||
|
|
||||||
|
1/19/98 - Retro-fit tri2obj to use shared normals rather than regenerating
|
||||||
|
normals for shared vertices.
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------
|
--------------------------------------------------------------------------
|
||||||
| Todo
|
| Todo
|
||||||
--------------------------------------------------------------------------
|
--------------------------------------------------------------------------
|
||||||
|
|
||||||
1/15/98 - Retro-fit tri2obj to use shared normals rather than regenerating
|
|
||||||
normals for shared vertices.
|
|
||||||
|
|
||||||
1/12/98 - Try reversing cw-wound strips rather than calling glFrontFace()
|
1/12/98 - Try reversing cw-wound strips rather than calling glFrontFace()
|
||||||
in the display list.
|
in the display list.
|
||||||
|
|
||||||
|
1/21/98 - Generate an elevation quad tree.
|
||||||
|
|
||||||
1/12/98 - Generate a face adjacency matrix
|
1/12/98 - Generate a face adjacency matrix
|
||||||
|
|
||||||
|
1/21/98 - Remove internal shared edges and corners that are not needed
|
||||||
|
after an area is generated.
|
||||||
|
|
|
@ -189,7 +189,7 @@ if ( $do_assemtris ) {
|
||||||
foreach $file ( @FILES ) {
|
foreach $file ( @FILES ) {
|
||||||
chop($file);
|
chop($file);
|
||||||
if ( $file =~ m/\.1\.body$/ ) {
|
if ( $file =~ m/\.1\.body$/ ) {
|
||||||
$file =~ s/\.body$//; # strip off the ".node"
|
$file =~ s/\.body$//; # strip off the ".body"
|
||||||
|
|
||||||
$command = "./AssemTris/assemtris $subdir/$file";
|
$command = "./AssemTris/assemtris $subdir/$file";
|
||||||
print "Running '$command'\n";
|
print "Running '$command'\n";
|
||||||
|
@ -199,6 +199,7 @@ if ( $do_assemtris ) {
|
||||||
}
|
}
|
||||||
close(OUT);
|
close(OUT);
|
||||||
}
|
}
|
||||||
|
unlink("$subdir/$file.body");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -328,6 +329,9 @@ if ( $do_fixobj ) {
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# $Log$
|
# $Log$
|
||||||
|
# Revision 1.9 1998/01/27 18:36:54 curt
|
||||||
|
# Lots of updates to get back in sync with changes made over in .../Src/
|
||||||
|
#
|
||||||
# Revision 1.8 1998/01/21 17:59:05 curt
|
# Revision 1.8 1998/01/21 17:59:05 curt
|
||||||
# Uncomment lines to remove several intermediate files.
|
# Uncomment lines to remove several intermediate files.
|
||||||
#
|
#
|
||||||
|
|
|
@ -32,12 +32,12 @@
|
||||||
|
|
||||||
#include "tri2obj.h"
|
#include "tri2obj.h"
|
||||||
|
|
||||||
#include "../../Src/Include/constants.h"
|
#include <Include/fg_constants.h>
|
||||||
#include "../../Src/Include/types.h"
|
#include <Include/fg_types.h>
|
||||||
#include "../../Src/Math/fg_geodesy.h"
|
#include <Math/fg_geodesy.h>
|
||||||
#include "../../Src/Math/mat3.h"
|
#include <Math/mat3.h>
|
||||||
#include "../../Src/Math/polar.h"
|
#include <Math/polar.h>
|
||||||
#include "../../Src/Scenery/tileutils.h"
|
#include <Scenery/bucketutils.h>
|
||||||
|
|
||||||
|
|
||||||
int nodecount, tricount;
|
int nodecount, tricount;
|
||||||
|
@ -48,9 +48,9 @@ int new_tris[MAX_TRIS][3];
|
||||||
|
|
||||||
float normals[MAX_NODES][3];
|
float normals[MAX_NODES][3];
|
||||||
|
|
||||||
struct bucket my_index;
|
struct fgBUCKET my_index;
|
||||||
struct bucket ne_index, nw_index, sw_index, se_index;
|
struct fgBUCKET ne_index, nw_index, sw_index, se_index;
|
||||||
struct bucket north_index, south_index, east_index, west_index;
|
struct fgBUCKET north_index, south_index, east_index, west_index;
|
||||||
|
|
||||||
/* convert a geodetic point lon(arcsec), lat(arcsec), elev(meter) to
|
/* convert a geodetic point lon(arcsec), lat(arcsec), elev(meter) to
|
||||||
* a cartesian point */
|
* a cartesian point */
|
||||||
|
@ -177,26 +177,26 @@ int shared_object_exists(char *basepath, char *ext, char *file) {
|
||||||
long int index;
|
long int index;
|
||||||
|
|
||||||
if ( strcmp(ext, ".sw") == 0 ) {
|
if ( strcmp(ext, ".sw") == 0 ) {
|
||||||
gen_base_path(&my_index, scene_path);
|
fgBucketGenBasePath(&my_index, scene_path);
|
||||||
index = gen_index(&my_index);
|
index = fgBucketGenIndex(&my_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.sw", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.sw", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&west_index, scene_path);
|
fgBucketGenBasePath(&west_index, scene_path);
|
||||||
index = gen_index(&west_index);
|
index = fgBucketGenIndex(&west_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.se", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.se", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&sw_index, scene_path);
|
fgBucketGenBasePath(&sw_index, scene_path);
|
||||||
index = gen_index(&sw_index);
|
index = fgBucketGenIndex(&sw_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.ne", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.ne", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&south_index, scene_path);
|
fgBucketGenBasePath(&south_index, scene_path);
|
||||||
index = gen_index(&south_index);
|
index = fgBucketGenIndex(&south_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.nw", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.nw", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
|
@ -204,26 +204,26 @@ int shared_object_exists(char *basepath, char *ext, char *file) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( strcmp(ext, ".se") == 0 ) {
|
if ( strcmp(ext, ".se") == 0 ) {
|
||||||
gen_base_path(&my_index, scene_path);
|
fgBucketGenBasePath(&my_index, scene_path);
|
||||||
index = gen_index(&my_index);
|
index = fgBucketGenIndex(&my_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.se", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.se", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&east_index, scene_path);
|
fgBucketGenBasePath(&east_index, scene_path);
|
||||||
index = gen_index(&east_index);
|
index = fgBucketGenIndex(&east_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.sw", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.sw", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&se_index, scene_path);
|
fgBucketGenBasePath(&se_index, scene_path);
|
||||||
index = gen_index(&se_index);
|
index = fgBucketGenIndex(&se_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.nw", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.nw", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&south_index, scene_path);
|
fgBucketGenBasePath(&south_index, scene_path);
|
||||||
index = gen_index(&south_index);
|
index = fgBucketGenIndex(&south_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.ne", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.ne", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
|
@ -231,26 +231,26 @@ int shared_object_exists(char *basepath, char *ext, char *file) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( strcmp(ext, ".ne") == 0 ) {
|
if ( strcmp(ext, ".ne") == 0 ) {
|
||||||
gen_base_path(&my_index, scene_path);
|
fgBucketGenBasePath(&my_index, scene_path);
|
||||||
index = gen_index(&my_index);
|
index = fgBucketGenIndex(&my_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.ne", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.ne", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&east_index, scene_path);
|
fgBucketGenBasePath(&east_index, scene_path);
|
||||||
index = gen_index(&east_index);
|
index = fgBucketGenIndex(&east_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.nw", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.nw", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&ne_index, scene_path);
|
fgBucketGenBasePath(&ne_index, scene_path);
|
||||||
index = gen_index(&ne_index);
|
index = fgBucketGenIndex(&ne_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.sw", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.sw", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&north_index, scene_path);
|
fgBucketGenBasePath(&north_index, scene_path);
|
||||||
index = gen_index(&north_index);
|
index = fgBucketGenIndex(&north_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.se", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.se", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
|
@ -258,26 +258,26 @@ int shared_object_exists(char *basepath, char *ext, char *file) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( strcmp(ext, ".nw") == 0 ) {
|
if ( strcmp(ext, ".nw") == 0 ) {
|
||||||
gen_base_path(&my_index, scene_path);
|
fgBucketGenBasePath(&my_index, scene_path);
|
||||||
index = gen_index(&my_index);
|
index = fgBucketGenIndex(&my_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.nw", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.nw", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&west_index, scene_path);
|
fgBucketGenBasePath(&west_index, scene_path);
|
||||||
index = gen_index(&west_index);
|
index = fgBucketGenIndex(&west_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.ne", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.ne", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&nw_index, scene_path);
|
fgBucketGenBasePath(&nw_index, scene_path);
|
||||||
index = gen_index(&nw_index);
|
index = fgBucketGenIndex(&nw_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.se", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.se", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&north_index, scene_path);
|
fgBucketGenBasePath(&north_index, scene_path);
|
||||||
index = gen_index(&north_index);
|
index = fgBucketGenIndex(&north_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.sw", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.sw", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
|
@ -285,14 +285,14 @@ int shared_object_exists(char *basepath, char *ext, char *file) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( strcmp(ext, ".south") == 0 ) {
|
if ( strcmp(ext, ".south") == 0 ) {
|
||||||
gen_base_path(&my_index, scene_path);
|
fgBucketGenBasePath(&my_index, scene_path);
|
||||||
index = gen_index(&my_index);
|
index = fgBucketGenIndex(&my_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.south", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.south", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&south_index, scene_path);
|
fgBucketGenBasePath(&south_index, scene_path);
|
||||||
index = gen_index(&south_index);
|
index = fgBucketGenIndex(&south_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.north", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.north", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
|
@ -300,14 +300,14 @@ int shared_object_exists(char *basepath, char *ext, char *file) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( strcmp(ext, ".north") == 0 ) {
|
if ( strcmp(ext, ".north") == 0 ) {
|
||||||
gen_base_path(&my_index, scene_path);
|
fgBucketGenBasePath(&my_index, scene_path);
|
||||||
index = gen_index(&my_index);
|
index = fgBucketGenIndex(&my_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.north", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.north", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&north_index, scene_path);
|
fgBucketGenBasePath(&north_index, scene_path);
|
||||||
index = gen_index(&north_index);
|
index = fgBucketGenIndex(&north_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.south", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.south", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
|
@ -315,14 +315,14 @@ int shared_object_exists(char *basepath, char *ext, char *file) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( strcmp(ext, ".west") == 0 ) {
|
if ( strcmp(ext, ".west") == 0 ) {
|
||||||
gen_base_path(&my_index, scene_path);
|
fgBucketGenBasePath(&my_index, scene_path);
|
||||||
index = gen_index(&my_index);
|
index = fgBucketGenIndex(&my_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.west", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.west", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&west_index, scene_path);
|
fgBucketGenBasePath(&west_index, scene_path);
|
||||||
index = gen_index(&west_index);
|
index = fgBucketGenIndex(&west_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.east", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.east", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
|
@ -330,14 +330,14 @@ int shared_object_exists(char *basepath, char *ext, char *file) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( strcmp(ext, ".east") == 0 ) {
|
if ( strcmp(ext, ".east") == 0 ) {
|
||||||
gen_base_path(&my_index, scene_path);
|
fgBucketGenBasePath(&my_index, scene_path);
|
||||||
index = gen_index(&my_index);
|
index = fgBucketGenIndex(&my_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.east", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.east", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
gen_base_path(&east_index, scene_path);
|
fgBucketGenBasePath(&east_index, scene_path);
|
||||||
index = gen_index(&east_index);
|
index = fgBucketGenIndex(&east_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.west", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.west", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
|
@ -345,8 +345,8 @@ int shared_object_exists(char *basepath, char *ext, char *file) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( strcmp(ext, ".body") == 0 ) {
|
if ( strcmp(ext, ".body") == 0 ) {
|
||||||
gen_base_path(&my_index, scene_path);
|
fgBucketGenBasePath(&my_index, scene_path);
|
||||||
index = gen_index(&my_index);
|
index = fgBucketGenIndex(&my_index);
|
||||||
sprintf(file, "%s/%s/%ld.1.body", basepath, scene_path, index);
|
sprintf(file, "%s/%s/%ld.1.body", basepath, scene_path, index);
|
||||||
if ( file_exists(file) ) {
|
if ( file_exists(file) ) {
|
||||||
return(1);
|
return(1);
|
||||||
|
@ -612,20 +612,20 @@ int main(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
tmp_index = atoi(temp);
|
tmp_index = atoi(temp);
|
||||||
printf("%ld\n", tmp_index);
|
printf("%ld\n", tmp_index);
|
||||||
parse_index(tmp_index, &my_index);
|
fgBucketParseIndex(tmp_index, &my_index);
|
||||||
|
|
||||||
printf("bucket = %d %d %d %d\n",
|
printf("bucket = %d %d %d %d\n",
|
||||||
my_index.lon, my_index.lat, my_index.x, my_index.y);
|
my_index.lon, my_index.lat, my_index.x, my_index.y);
|
||||||
/* generate the indexes of the neighbors */
|
/* generate the indexes of the neighbors */
|
||||||
offset_bucket(&my_index, &ne_index, 1, 1);
|
fgBucketOffset(&my_index, &ne_index, 1, 1);
|
||||||
offset_bucket(&my_index, &nw_index, -1, 1);
|
fgBucketOffset(&my_index, &nw_index, -1, 1);
|
||||||
offset_bucket(&my_index, &se_index, 1, -1);
|
fgBucketOffset(&my_index, &se_index, 1, -1);
|
||||||
offset_bucket(&my_index, &sw_index, -1, -1);
|
fgBucketOffset(&my_index, &sw_index, -1, -1);
|
||||||
|
|
||||||
offset_bucket(&my_index, &north_index, 0, 1);
|
fgBucketOffset(&my_index, &north_index, 0, 1);
|
||||||
offset_bucket(&my_index, &south_index, 0, -1);
|
fgBucketOffset(&my_index, &south_index, 0, -1);
|
||||||
offset_bucket(&my_index, &east_index, 1, 0);
|
fgBucketOffset(&my_index, &east_index, 1, 0);
|
||||||
offset_bucket(&my_index, &west_index, -1, 0);
|
fgBucketOffset(&my_index, &west_index, -1, 0);
|
||||||
|
|
||||||
/* load the input data files */
|
/* load the input data files */
|
||||||
triload(basename, basepath);
|
triload(basename, basepath);
|
||||||
|
@ -638,9 +638,12 @@ int main(int argc, char **argv) {
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.8 1998/01/17 01:25:39 curt
|
/* Revision 1.9 1998/01/27 18:37:04 curt
|
||||||
/* Added support for shared normals.
|
/* Lots of updates to get back in sync with changes made over in .../Src/
|
||||||
/*
|
/*
|
||||||
|
* Revision 1.8 1998/01/17 01:25:39 curt
|
||||||
|
* Added support for shared normals.
|
||||||
|
*
|
||||||
* Revision 1.7 1998/01/12 02:42:00 curt
|
* Revision 1.7 1998/01/12 02:42:00 curt
|
||||||
* Average up to five triangles per vertex instead of three.
|
* Average up to five triangles per vertex instead of three.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Reference in a new issue