Cumulative tweaks.
This commit is contained in:
parent
524ec03927
commit
904d046c7a
7 changed files with 182 additions and 62 deletions
|
@ -1,4 +1,23 @@
|
|||
assemtris.o: assemtris.c assemtris.h ../../Src/Include/constants.h \
|
||||
../../Src/Include/types.h ../../Src/Math/fg_geodesy.h \
|
||||
../../Src/Math/mat3.h ../../Src/Math/polar.h \
|
||||
../../Src/Math/../Include/types.h ../../Src/Scenery/tileutils.h
|
||||
assemtris.o: assemtris.c /usr/include/math.h /usr/include/features.h \
|
||||
/usr/include/sys/cdefs.h /usr/include/huge_val.h \
|
||||
/usr/include/endian.h /usr/include/bytesex.h /usr/include/nan.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.7.2.1/include/float.h \
|
||||
/usr/include/values.h /usr/include/ieee754.h \
|
||||
/usr/include/i386/ieeefp.h /usr/include/ieee854.h \
|
||||
/usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \
|
||||
/usr/include/stdlib.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.7.2.1/include/stddef.h \
|
||||
/usr/include/errno.h /usr/include/linux/errno.h \
|
||||
/usr/include/asm/errno.h /usr/include/alloca.h /usr/include/string.h \
|
||||
/usr/include/sys/stat.h /usr/include/sys/types.h \
|
||||
/usr/include/linux/types.h /usr/include/linux/posix_types.h \
|
||||
/usr/include/asm/posix_types.h /usr/include/asm/types.h \
|
||||
/usr/include/sys/bitypes.h /usr/include/linux/stat.h \
|
||||
/usr/include/unistd.h /usr/include/posix_opt.h \
|
||||
/usr/include/gnu/types.h /usr/include/confname.h assemtris.h \
|
||||
/home/home17/curt/projects/FlightGear/Src/Include/fg_constants.h \
|
||||
/home/home17/curt/projects/FlightGear/Src/Include/fg_types.h \
|
||||
/home/home17/curt/projects/FlightGear/Src/Math/fg_geodesy.h \
|
||||
/home/home17/curt/projects/FlightGear/Src/Math/mat3.h \
|
||||
/home/home17/curt/projects/FlightGear/Src/Math/polar.h \
|
||||
/home/home17/curt/projects/FlightGear/Src/Scenery/bucketutils.h
|
||||
|
|
|
@ -214,7 +214,7 @@ void obj_fix(char *infile, char *outfile) {
|
|||
}
|
||||
|
||||
dot_prod = check_cur_face(n1, n2, n3);
|
||||
if ( dot_prod < -0.5 ) {
|
||||
if ( dot_prod < 0.0 ) {
|
||||
/* this stripe is backwards (CW) */
|
||||
is_ccw = 0;
|
||||
printf(" -> Starting a backwards stripe\n");
|
||||
|
@ -288,9 +288,12 @@ void obj_fix(char *infile, char *outfile) {
|
|||
|
||||
|
||||
/* $Log$
|
||||
/* Revision 1.4 1998/01/31 00:41:25 curt
|
||||
/* Made a few changes converting floats to doubles.
|
||||
/* Revision 1.5 1998/03/03 03:37:03 curt
|
||||
/* Cumulative tweaks.
|
||||
/*
|
||||
* Revision 1.4 1998/01/31 00:41:25 curt
|
||||
* Made a few changes converting floats to doubles.
|
||||
*
|
||||
* Revision 1.3 1998/01/19 19:51:07 curt
|
||||
* A couple final pre-release tweaks.
|
||||
*
|
||||
|
|
|
@ -1,4 +1,23 @@
|
|||
splittris.o: splittris.c splittris.h ../../Src/Include/constants.h \
|
||||
../../Src/Include/types.h ../../Src/Math/fg_geodesy.h \
|
||||
../../Src/Math/mat3.h ../../Src/Math/polar.h \
|
||||
../../Src/Math/../Include/types.h ../../Src/Scenery/tileutils.h
|
||||
splittris.o: splittris.c /usr/include/math.h /usr/include/features.h \
|
||||
/usr/include/sys/cdefs.h /usr/include/huge_val.h \
|
||||
/usr/include/endian.h /usr/include/bytesex.h /usr/include/nan.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.7.2.1/include/float.h \
|
||||
/usr/include/values.h /usr/include/ieee754.h \
|
||||
/usr/include/i386/ieeefp.h /usr/include/ieee854.h \
|
||||
/usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \
|
||||
/usr/include/stdlib.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.7.2.1/include/stddef.h \
|
||||
/usr/include/errno.h /usr/include/linux/errno.h \
|
||||
/usr/include/asm/errno.h /usr/include/alloca.h /usr/include/string.h \
|
||||
/usr/include/sys/stat.h /usr/include/sys/types.h \
|
||||
/usr/include/linux/types.h /usr/include/linux/posix_types.h \
|
||||
/usr/include/asm/posix_types.h /usr/include/asm/types.h \
|
||||
/usr/include/sys/bitypes.h /usr/include/linux/stat.h \
|
||||
/usr/include/unistd.h /usr/include/posix_opt.h \
|
||||
/usr/include/gnu/types.h /usr/include/confname.h splittris.h \
|
||||
/home/home17/curt/projects/FlightGear/Src/Include/fg_constants.h \
|
||||
/home/home17/curt/projects/FlightGear/Src/Include/fg_types.h \
|
||||
/home/home17/curt/projects/FlightGear/Src/Math/fg_geodesy.h \
|
||||
/home/home17/curt/projects/FlightGear/Src/Math/mat3.h \
|
||||
/home/home17/curt/projects/FlightGear/Src/Math/polar.h \
|
||||
/home/home17/curt/projects/FlightGear/Src/Scenery/bucketutils.h
|
||||
|
|
|
@ -456,8 +456,11 @@ void dump_obj(char *basename, char *basepath) {
|
|||
} else {
|
||||
fp = body;
|
||||
}
|
||||
fprintf(fp, "gdn %.2f %.2f %.2f\n",
|
||||
nodes_orig[i][0], nodes_orig[i][1], nodes_orig[i][2]);
|
||||
|
||||
if ( fp != NULL ) {
|
||||
fprintf(fp, "gdn %.2f %.2f %.2f\n",
|
||||
nodes_orig[i][0], nodes_orig[i][1], nodes_orig[i][2]);
|
||||
}
|
||||
}
|
||||
|
||||
printf(" calculating and writing normals\n");
|
||||
|
@ -541,17 +544,17 @@ void dump_obj(char *basename, char *basepath) {
|
|||
}
|
||||
}
|
||||
|
||||
fclose(sw);
|
||||
fclose(se);
|
||||
fclose(ne);
|
||||
fclose(nw);
|
||||
if ( sw ) { fclose(sw); }
|
||||
if ( se ) { fclose(se); }
|
||||
if ( ne ) { fclose(ne); }
|
||||
if ( nw ) { fclose(nw); }
|
||||
|
||||
fclose(north);
|
||||
fclose(south);
|
||||
fclose(east);
|
||||
fclose(west);
|
||||
if ( north ) { fclose(north); }
|
||||
if ( south ) { fclose(south); }
|
||||
if ( east ) { fclose(east); }
|
||||
if ( west ) { fclose(west); }
|
||||
|
||||
fclose(body);
|
||||
if ( body ) { fclose(body); }
|
||||
}
|
||||
|
||||
|
||||
|
@ -609,9 +612,12 @@ int main(int argc, char **argv) {
|
|||
|
||||
|
||||
/* $Log$
|
||||
/* Revision 1.4 1998/01/31 00:41:26 curt
|
||||
/* Made a few changes converting floats to doubles.
|
||||
/* Revision 1.5 1998/03/03 03:37:04 curt
|
||||
/* Cumulative tweaks.
|
||||
/*
|
||||
* Revision 1.4 1998/01/31 00:41:26 curt
|
||||
* Made a few changes converting floats to doubles.
|
||||
*
|
||||
* Revision 1.3 1998/01/27 18:37:04 curt
|
||||
* Lots of updates to get back in sync with changes made over in .../Src/
|
||||
*
|
||||
|
|
|
@ -40,16 +40,6 @@ $do_strips = 1;
|
|||
$do_fixobj = 1;
|
||||
|
||||
|
||||
# return the file name root (ending at last ".")
|
||||
sub file_root {
|
||||
my($file) = @_;
|
||||
my($pos);
|
||||
|
||||
$pos = rindex($file, ".");
|
||||
return substr($file, 0, $pos);
|
||||
}
|
||||
|
||||
|
||||
# set the FG_ROOT environment variable if it hasn't already been set.
|
||||
if ( $ENV{FG_ROOT} eq "" ) {
|
||||
# look for a file called fgtop as a place marker
|
||||
|
@ -61,26 +51,64 @@ if ( $ENV{FG_ROOT} eq "" ) {
|
|||
}
|
||||
|
||||
|
||||
# 1. Start with file.dem
|
||||
if ( $#ARGV < 1 ) {
|
||||
die "Usage: $0 <error^2> dem-file1 [ dem-file2 dem-file3 ... ]\n";
|
||||
}
|
||||
|
||||
# Start with file.dem
|
||||
|
||||
$dem_file = shift(@ARGV);
|
||||
$error = shift(@ARGV);
|
||||
$error += 0.0;
|
||||
|
||||
print "Source file = $dem_file Error tolerance = $error\n";
|
||||
while ( $dem_file = shift(@ARGV) ) {
|
||||
print "Source file = $dem_file Error tolerance = $error\n";
|
||||
|
||||
if ( $error < 0.5 ) {
|
||||
die "I doubt you'll be happy with an error tolerance as low as $error.\n";
|
||||
if ( $error < 0.5 ) {
|
||||
die "I doubt you'll be happy with an error tolerance as " .
|
||||
"low as $error.\n";
|
||||
}
|
||||
|
||||
|
||||
if ( $do_demfit ) {
|
||||
demfit() ;
|
||||
} else {
|
||||
$subdir = "../Scenery/w100n040/w093n045";
|
||||
print "WARNING: Hardcoding subdir = $subdir\n";
|
||||
}
|
||||
|
||||
triangle_1() if ( $do_triangle_1 );
|
||||
fixnode() if ( $do_fixnode );
|
||||
splittris() if ( $do_splittris );
|
||||
assemtris() if ( $do_assemtris );
|
||||
triangle_2() if ( $do_triangle_2);
|
||||
tri2obj() if ( $do_tri2obj );
|
||||
strips() if ( $do_strips );
|
||||
fixobj() if ( $do_fixobj );
|
||||
}
|
||||
|
||||
# 2. dem2node $FG_ROOT dem_file tolerance^2 (meters)
|
||||
|
||||
# exit normally
|
||||
exit(0);
|
||||
|
||||
|
||||
# return the file name root (ending at last ".")
|
||||
sub file_root {
|
||||
my($file) = @_;
|
||||
my($pos);
|
||||
|
||||
$pos = rindex($file, ".");
|
||||
return substr($file, 0, $pos);
|
||||
}
|
||||
|
||||
|
||||
# 1. dem2node $FG_ROOT dem_file tolerance^2 (meters)
|
||||
#
|
||||
# - dem2node .. dem_file 160000
|
||||
#
|
||||
# splits dem file into 64 file.node's which contain the
|
||||
# irregularly fitted vertices
|
||||
|
||||
if ( $do_demfit ) {
|
||||
sub demfit {
|
||||
if ( $dem_file =~ m/.gz$/ ) {
|
||||
$command = "gzip -dc $dem_file | ./Dem2node/demfit $ENV{FG_ROOT} - $error";
|
||||
} else {
|
||||
|
@ -99,17 +127,15 @@ if ( $do_demfit ) {
|
|||
}
|
||||
}
|
||||
close(OUT);
|
||||
} else {
|
||||
$subdir = "../Scenery/w100n040/w093n045";
|
||||
print "WARNING: Hardcoding subdir = $subdir\n";
|
||||
}
|
||||
}
|
||||
|
||||
# 3. triangle -q file (Takes file.node and produces file.1.node and
|
||||
|
||||
# 2. triangle -q file (Takes file.node and produces file.1.node and
|
||||
# file.1.ele)
|
||||
|
||||
print "Subdirectory for this dem file is $subdir\n";
|
||||
|
||||
if ( $do_triangle_1 ) {
|
||||
sub triangle_1 {
|
||||
@FILES = `ls $subdir`;
|
||||
foreach $file ( @FILES ) {
|
||||
print $file;
|
||||
|
@ -129,13 +155,14 @@ if ( $do_triangle_1 ) {
|
|||
}
|
||||
}
|
||||
|
||||
# 4. fixnode file.dem subdir
|
||||
|
||||
# 3. fixnode file.dem subdir
|
||||
#
|
||||
# Take the original .dem file (for interpolating Z values) and the
|
||||
# subdirecotry containing all the file.1.node's and replace with
|
||||
# fixed file.1.node
|
||||
|
||||
if ( $do_fixnode ) {
|
||||
sub fixnode {
|
||||
if ( $dem_file =~ m/.gz$/ ) {
|
||||
$command = "gzip -dc $dem_file | ./FixNode/fixnode - $subdir";
|
||||
} else {
|
||||
|
@ -165,7 +192,7 @@ if ( $do_fixnode ) {
|
|||
# gets to define the edge verticies and normals. All the other
|
||||
# adjacent tiles must use these.
|
||||
|
||||
if ( $do_splittris ) {
|
||||
sub splittris {
|
||||
@FILES = `ls $subdir`;
|
||||
foreach $file ( @FILES ) {
|
||||
chop($file);
|
||||
|
@ -192,7 +219,7 @@ if ( $do_splittris ) {
|
|||
# using the proper shared corners and edges. Save as a node file
|
||||
# so we can retriangulate.
|
||||
|
||||
if ( $do_assemtris ) {
|
||||
sub assemtris {
|
||||
@FILES = `ls $subdir`;
|
||||
foreach $file ( @FILES ) {
|
||||
chop($file);
|
||||
|
@ -215,7 +242,7 @@ if ( $do_assemtris ) {
|
|||
# 4.3 Retriangulate reassembled files (without -q option) so no new
|
||||
# nodes are generated.
|
||||
|
||||
if ( $do_triangle_2 ) {
|
||||
sub triangle_2 {
|
||||
@FILES = `ls $subdir`;
|
||||
foreach $file ( @FILES ) {
|
||||
print $file;
|
||||
|
@ -246,7 +273,7 @@ if ( $do_triangle_2 ) {
|
|||
# the gaps between tiles eliminated, but the colors and lighting
|
||||
# transition smoothly across tile boundaries.
|
||||
|
||||
if ( $do_tri2obj ) {
|
||||
sub tri2obj {
|
||||
@FILES = `ls $subdir`;
|
||||
foreach $file ( @FILES ) {
|
||||
chop($file);
|
||||
|
@ -278,7 +305,7 @@ if ( $do_tri2obj ) {
|
|||
#
|
||||
# strips produces a file called "bands.d" ... copy this to file.2.obj
|
||||
|
||||
if ( $do_strips ) {
|
||||
sub strips {
|
||||
@FILES = `ls $subdir`;
|
||||
foreach $file ( @FILES ) {
|
||||
chop($file);
|
||||
|
@ -313,7 +340,7 @@ if ( $do_strips ) {
|
|||
#
|
||||
# Sort file.2.obj by strip winding
|
||||
|
||||
if ( $do_fixobj ) {
|
||||
sub fixobj {
|
||||
@FILES = `ls $subdir`;
|
||||
foreach $file ( @FILES ) {
|
||||
chop($file);
|
||||
|
@ -337,6 +364,9 @@ if ( $do_fixobj ) {
|
|||
|
||||
#---------------------------------------------------------------------------
|
||||
# $Log$
|
||||
# Revision 1.11 1998/03/03 03:36:57 curt
|
||||
# Cumulative tweaks.
|
||||
#
|
||||
# Revision 1.10 1998/02/01 03:42:26 curt
|
||||
# Modifications to handle compressed dem files.
|
||||
#
|
||||
|
|
|
@ -1,4 +1,23 @@
|
|||
tri2obj.o: tri2obj.c tri2obj.h ../../Src/Include/constants.h \
|
||||
../../Src/Include/types.h ../../Src/Math/fg_geodesy.h \
|
||||
../../Src/Math/mat3.h ../../Src/Math/polar.h \
|
||||
../../Src/Math/../Include/types.h ../../Src/Scenery/tileutils.h
|
||||
tri2obj.o: tri2obj.c /usr/include/stdio.h /usr/include/features.h \
|
||||
/usr/include/sys/cdefs.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/stdlib.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.7.2.1/include/stddef.h \
|
||||
/usr/include/errno.h /usr/include/linux/errno.h \
|
||||
/usr/include/asm/errno.h /usr/include/alloca.h /usr/include/string.h \
|
||||
/usr/include/sys/stat.h /usr/include/sys/types.h \
|
||||
/usr/include/linux/types.h /usr/include/linux/posix_types.h \
|
||||
/usr/include/asm/posix_types.h /usr/include/asm/types.h \
|
||||
/usr/include/sys/bitypes.h /usr/include/linux/stat.h \
|
||||
/usr/include/unistd.h /usr/include/posix_opt.h \
|
||||
/usr/include/gnu/types.h /usr/include/confname.h tri2obj.h \
|
||||
/home/home17/curt/projects/FlightGear/Src/Include/fg_constants.h \
|
||||
/usr/include/math.h /usr/include/huge_val.h /usr/include/endian.h \
|
||||
/usr/include/bytesex.h /usr/include/nan.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.7.2.1/include/float.h \
|
||||
/usr/include/values.h /usr/include/ieee754.h \
|
||||
/usr/include/i386/ieeefp.h /usr/include/ieee854.h \
|
||||
/home/home17/curt/projects/FlightGear/Src/Include/fg_types.h \
|
||||
/home/home17/curt/projects/FlightGear/Src/Math/fg_geodesy.h \
|
||||
/home/home17/curt/projects/FlightGear/Src/Math/mat3.h \
|
||||
/home/home17/curt/projects/FlightGear/Src/Math/polar.h \
|
||||
/home/home17/curt/projects/FlightGear/Src/Scenery/bucketutils.h
|
||||
|
|
|
@ -1,3 +1,27 @@
|
|||
showme.o: showme.c
|
||||
triangle.o: triangle.c
|
||||
tricall.o: tricall.c triangle.h
|
||||
showme.o: showme.c /usr/include/stdio.h /usr/include/features.h \
|
||||
/usr/include/sys/cdefs.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/string.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.7.2.1/include/stddef.h \
|
||||
/usr/include/X11/Xlib.h /usr/include/sys/types.h \
|
||||
/usr/include/linux/types.h /usr/include/linux/posix_types.h \
|
||||
/usr/include/asm/posix_types.h /usr/include/asm/types.h \
|
||||
/usr/include/sys/bitypes.h /usr/include/X11/X.h \
|
||||
/usr/include/X11/Xfuncproto.h /usr/include/X11/Xosdefs.h \
|
||||
/usr/include/X11/Xutil.h /usr/include/X11/Xatom.h
|
||||
triangle.o: triangle.c /usr/include/stdio.h /usr/include/features.h \
|
||||
/usr/include/sys/cdefs.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/string.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.7.2.1/include/stddef.h \
|
||||
/usr/include/math.h /usr/include/huge_val.h /usr/include/endian.h \
|
||||
/usr/include/bytesex.h /usr/include/nan.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.7.2.1/include/float.h \
|
||||
/usr/include/values.h /usr/include/ieee754.h \
|
||||
/usr/include/i386/ieeefp.h /usr/include/ieee854.h \
|
||||
/usr/include/sys/time.h /usr/include/linux/types.h \
|
||||
/usr/include/linux/posix_types.h /usr/include/asm/posix_types.h \
|
||||
/usr/include/asm/types.h /usr/include/linux/time.h \
|
||||
/usr/include/time.h /usr/include/sys/types.h \
|
||||
/usr/include/sys/bitypes.h
|
||||
tricall.o: tricall.c /usr/include/stdio.h /usr/include/features.h \
|
||||
/usr/include/sys/cdefs.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h triangle.h
|
||||
|
|
Loading…
Add table
Reference in a new issue