Virtual Playa
(http://www.virtualplaya.org
) has Microsoft Flight Simulator models of various
Burning Man
(http://www.burningman.com
) structures.
http://www.virtualplaya.org
.bgl
files. We extended a bgl converted for Pretty Poly Editor
(PPE,
http://prettypoly.sourceforge.net
) and converted the Virtual Playa
objects to a format suitable for FlightGear.
NOTE: The following objects do not work 2003man, 2003honor, centercampl, centercamp2. I think the reason these objects do not works is because they have more than 32767 vertices, which is more than will fit in a short.
.bgl
files to .ssg
files
is covered below. Here, we cover how to get the models into the Windows
port of FlightGear.
http://www.flightgear.org/Downloads/
and install it. In August, 2005, I used FlightGear 0.9.8.
w120n40
file, which is available from
http://www.flightgear.org/Downloads/scenery.html
http://www.flightgear.org/Docs/FAQ.shtml#2.6
c:/Program Files/FlightGear/Scenery/w120n40/w120n40
.
UFO from the 'White Project' of the UNESCO
Longitude: -119.23 Latitude: 40.75
Num Lock
and then type 9
on the numeric keypad.
On some keyboards, you may need to type Shift-9
http://www.flightgear.org/docs.html
.ssg
files and the bitmaps.
Note that because of a bug in plib, we flipped the bitmaps and provide them in tar file.
http://ptolemy.eecs.berkeley.edu/~cxh/sapub/2005_VPlaya_Scenery_0828_flightgear_flipped_1002.tar.gz
Use This One
http://ptolemy.eecs.berkeley.edu/~cxh/sapub/virtual_playa_1.2_addons_flipped_flightgear.tar.gz
Available only for historical reasons
.bmp
files to the top level directory
of FlightGear:
cp *.bmp c:/Program\ Files/FlightGear
.ssg
and .stg files to the appropriate directory
c:/Program Files/FlightGear/scenery/w120n40/w120n40
c:/Program Files/FlightGear/data/Scenery/Objects/w120n40/w120n40
For example:
cp *.ssg *.stg c:/Program\ Files/FlightGear/scenery/w120n40/w120n40
991419.stg
which tells FlightGear where to locate
the Burning Man objects.
.ssg
files which are converted
from the .bgl
files.
cp *.bmp c:/Program Files/FlightGear/
2003man.bgl
file to a 2003man.ssg
file, but when I try to run with
the 2003man.ssg
file in the
c:/Program Files/FlightGear/data/Scenery/Objects/w120n40/w120n40/991419.stg
file, then FlightGear seg faults. The problem is
that objects (DRAWTRILISTs) are limited to 10921 vertices because in FlightGear,the three vertices of a triangle are stored in a short.
(10/2005)I'm able to convert more complex objects, though the man still looks odd.
bgl.out:WARNING: ssgLoadTexture: Failed to open '123B2SU1.BMP' for reading. bgl.out:WARNING: ssgLoadTexture: Failed to open '127B2SU1.BMP' for reading. bgl.out:WARNING: ssgLoadTexture: Failed to open '256B2SU1.BMP' for reading. bgl.out:WARNING: ssgLoadTexture: Failed to open '258B2SU1.BMP' for reading. bgl.out:WARNING: ssgLoadTexture: Failed to open 'BADDATA.BMP' for reading. bgl.out:WARNING: ssgLoadTexture: Failed to open 'TRUCKF.BMP' for reading. bgl.out:WARNING: ssgLoadTexture: Failed to open 'UNTITLED-1 COPY.BMP' for reading. bgl.out:WARNING: ssgLoadTexture: Failed to open './123B2SU1.BMP' for reading. bgl.out:WARNING: ssgLoadTexture: Failed to open './127B2SU1.BMP' for reading. bgl.out:WARNING: ssgLoadTexture: Failed to open './256B2SU1.BMP' for reading. bgl.out:WARNING: ssgLoadTexture: Failed to open './258B2SU1.BMP' for reading. bgl.out:WARNING: ssgLoadTexture: Failed to open './BADDATA.BMP' for reading. bgl.out:WARNING: ssgLoadTexture: Failed to open './TRUCKF.BMP' for reading. bgl.out:WARNING: ssgLoadTexture: Failed to open './UNTITLED-1 COPY.BMP' for reading. testwow.out:WARNING: ssgLoadTexture: Failed to open '123B2SU1.BMP' for reading. testwow.out:WARNING: ssgLoadTexture: Failed to open '127B2SU1.BMP' for reading. testwow.out:WARNING: ssgLoadTexture: Failed to open '256B2SU1.BMP' for reading. testwow.out:WARNING: ssgLoadTexture: Failed to open '258B2SU1.BMP' for reading. testwow.out:WARNING: ssgLoadTexture: Failed to open 'BADDATA.BMP' for reading. testwow.out:WARNING: ssgLoadTexture: Failed to open 'TRUCKF.BMP' for reading. testwow.out:WARNING: ssgLoadTexture: Failed to open 'UNTITLED-1 COPY.BMP' for reading. testwow.out:WARNING: ssgLoadTexture: Failed to open './123B2SU1.BMP' for reading. testwow.out:WARNING: ssgLoadTexture: Failed to open './127B2SU1.BMP' for reading. testwow.out:WARNING: ssgLoadTexture: Failed to open './256B2SU1.BMP' for reading. testwow.out:WARNING: ssgLoadTexture: Failed to open './258B2SU1.BMP' for reading. testwow.out:WARNING: ssgLoadTexture: Failed to open './BADDATA.BMP' for reading. testwow.out:WARNING: ssgLoadTexture: Failed to open './TRUCKF.BMP' for reading. testwow.out:WARNING: ssgLoadTexture: Failed to open './UNTITLED-1 COPY.BMP' for reading.In addition, for the 08/22/05 download, I had to scrounge up
258B2SU1.BMP 5WHEEL.BMP ALTO.BMP ARID.BMP AUDI1.BMP BANNER4.BMP BLUECANVAS.BMP BUDGET.BMP BUMP.BMP CARPET.BMP CCHECKPT.BMP CEARTHGURD.BMP CENTER FLAG.BMP CENTERCAFE.BMP CHROME CRECYCLE.BMP FENCE.BMP FIATP.BMP FORDVAN.BMP FURNITURE_WOOD GREGORYH.BMP HEARSE.BMP HMMWV.BMP INTREPID.BMP IRONPLATE.BMP LAMP.BMP LINCONTC.BMP MAGNETIC.BMP MURSTONE23.BMP PORTACABIN.BMP POTTIE.BMP ROOF.BMP ROVER.BMP RUSTY.BMP RUSTY2.BMP RVB.BMP RVBACK1.BMP RVF.BMP RVPACEFRONT.BMP RVPACESIDE.BMP RVS.BMP RVT.BMP SWEDISHCAMMO.BMP TARP1.BMP TARPBLK.BMP TARPWHT.BMP TEMPLEBOTTOM.BMP TENT8.BMP TRKVPLAYA.BMP TRNSVAN.BMP TRUCK.BMP TRUCKSID.BMP TRUCKTOP.BMP UHAUL.BMP UHAULSIDE.BMP VCAR.BMP VCARAVAN.BMP VSUV.BMP VTRUCK.BMP WHEEL.BMPfrom older releases.
Also, CHROME_LM.bmp
is corrupt and
GREGORYH.BMP
is missing
Note that we are working with Version 1.2 from February, 2004, not Virtual Playa 1.5 from January, 2005. The reason is that 1.2 uses MSFS 2002 and 1.5 uses MSFS 2004 and the format changed.
Downloaded the Virtual Playa base pack fromhttp://ptolemy.eecs.berkeley.edu/~cxh/sapub/virtual_playa_1.2_feb_2004.zip
(The original files can be found athttp://www.virtualplaya.org/downloads.html
)- Download the add ons
http://www.virtualplaya.org/addons.html
- The lamps and other bitmaps are upside down.
This is a bug in plib, seehttp://sourceforge.net/tracker/index.php?func=detail&aid=1275291&group_id=382&atid=100382
One solution is to compile plib, SimGear and FlightGear by hand with a patch to plib.
Another solution is to flip over the bmps. For example, one can use ImageMagick's
mogrify
command/bin/mogrify -flip -transparent black -channel alpha -negate -depth 8 -compress none *.bmp
chrome_t.bmp
is corrupt.
WARNING: ssgLoadSSG: File appears to be byte swapped! Failed to load 3D modelPresumably the ssg files also fail under Linux.
http://sourceforge.net/mailarchive/forum.php?thread_id=198292&forum_id=4479
discusses the design philosophy behind ssg and why byte order matters.
http://www.flightgear.org/Docs/FAQ.shtml#6.7
uses .ac files, which are the "format produced by the 'AC3D' modelling tool"
http://www.cygwin.com
. Basically, you need a full install,
or at least g++, gcc OpenGL, automake,
fltk, jpeg, libjpeg62, libjpeg6b, libpng, python,
8/05, 5/20/05 - I'm using plib-1.8.4
5/20/04 - I'm using plib-1.8.3
plib-xxx/src/ssg
ssgLoadBGL.cxx
ssgLoadBGL.h
ssgAddModelFormat
and add
ssgAddModelFormat ( ".bgl", ssgLoadBGL , NULL ) ;
ssgEntity *ssgLoadBGL ( const char *fname, const ssgLoaderOptions *options = NULL ) ;
/* read and flip image */ { int row_size = w * (bpp / 8) ; for ( int y = h-1 ; y >= 0 ; y-- ) { GLubyte *row_ptr = &data [ y * row_size ] ; if ( fread ( row_ptr, 1, row_size, curr_image_fd ) != (unsigned)row_size ) { ulSetError ( UL_WARNING, "Premature EOF in '%s'", curr_image_fname ) ; return false ; } } }Change the for loop:
// for ( int y = h-1 ; y >= 0 ; y-- ) // Don't FLIP for ( int y = 0 ; y < h-1 ; y++ ) {You'll need this to avoid having the bitmaps be inverted
http://sourceforge.net/tracker/index.php?func=detail&aid=1275291&group_id=382&atid=100382
cd plib-1.8.4; ./configure; make; make install
FlightGear-0.9.8/utils/Modeller/3dconvert.cxx
is a simple C++ file that produces a non-graphical
filter that take two command line arguments: the input
file and the output file.
See below for details.
cd ppe/src rm ppe.exe make cp ppe.exe c:/cygwin/usr/local/bin/ppe.exe
ppe.exe
on your .bgl
file:
/usr/local/bin/ppe foo.bglNote: ppe under Cygwin tends to hang in a tight loop, consuming 100% of the CPU if it gets a window expose event. The workaround is to work only in the ppe window after it comes up.
.cam
file and load it
.py
file, for example
camera.py
camera.py
file:
ppe foo.bgl camera.py
Useful resources:
http://www.scasm.de/doc/index.htm
http://freesc.sourceforge.net/scdis.html
Hmm, looks like ssgLoadMDL might have what we need?
http://cvs.sourceforge.net/viewcvs.py/plib/plib/src/ssg/ssgLoadMDL.cxx
says:
Revision 1.49 - (download), view (text) (markup) (annotate) - [select for diffs]
Mon Dec 8 08:22:12 2003 UTC (5 months, 1 week ago) by wolfram_kuss
Changes since 1.48: +370 -184 lines
Diff to previous 1.48Implemented the most important commands for CFS2 and FS2k2 files (includign "functionality").
Split off some functions for better readability
utils/Modeller/3dconvert.cxx
which creates utils/Modeller/threedconvert.exe
which
can be used to convert files without starting up ppe.
Edit utils/Modeller/3dconvert.cxx
and comment out the simgear/compiler.h
include
and the SG_GLUT_H
include and add GL/glut.h
//#include <simgear/compiler.h> #include <iostream> //#include SG_GLUT_H #include <GL/glut.h>Compile with
g++ 3dconvert.cxx -o threedconverter.exe -lplibssg -lplibsg -lplibul -lglut32 -lglu32 -lopengl32 -luser32 -lgdi32 -lwinmm ~/src/fg/FlightGear-0.9.8/utils/modeller/threedconvert.exe brc1.ssg brc1.atg
convert
utility. To run it, use
convert lamp.bmp sgi:lamp.rgb
convert lamp.bmp -transparent "#000000" sgi:lamp.rgb
SimGear-0.3.5/simgear/io/sg_binobj.hxx
cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/plib login cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/plib co plib/examples
The workaround under 0.9.6 is to turn off specular reflection. View -> Rendering Options -> Unselect Specular Reflection
The fix is to modify ssgLoadBGL.cxx so it properly sets the specular material.
If I edit 2004handofgod.bgl and change
MAGASHEAR.BMP
to
MAGASHEAR.RGB
and then convert the file using
bmptoppm magashear.bmp | pnmtosgi > magashear.rgbthen ppe displays the new 2004handofgod-new.bgl file with the image in the proper orientation.
The code in the plib sslLoadBMP.cxx
that
reads the bmp file is:
/* read and flip image */ { int row_size = w * (bpp / 8) ; for ( int y = h-1 ; y >= 0 ; y-- ) { GLubyte *row_ptr = &data [ y * row_size ] ; if ( fread ( row_ptr, 1, row_size, curr_image_fd ) != (unsigned)row_size ) { ulSetError ( UL_WARNING, "Premature EOF in '%s'", curr_image_fname ) ; return false ; } } }If I change the for loop:
// for ( int y = h-1 ; y >= 0 ; y-- ) // Don't FLIP for ( int y = 0 ; y < h-1 ; y++ ) {then the bitmaps view properly.
The downside with this is that it requires FlightGear be compiled with a new version of plib.
One solution would be to flip the images:
bmptoppm magashear.bmp | pnmflip -tb | ppmtobmp > magashear.bmp
It looks like a plib bug, see
http://sourceforge.net/tracker/index.php?func=detail&aid=1275291&group_id=382&atid=100382
aclocal automake --add-missing autoconf ./configure makeHowever, the data files are missing
http://jsbsim.sourceforge.net/JSBSimCUJ.PDF
JSBSim Overview Technical Note
http://jsbsim.sourceforge.net/AutomaticFlightInJSBSim.pdf
Automatic Flight in JSBSim (PDF - work in progress) September 16, 2003
/FlightGear-0.9.3/src/FDM/JSBSim/FGPosition.h
has methods that set the Latitude and Longitude. Other classes are:
FGModel (base): < FGAtmosphere (atmosphere) < FGFCS (flight control system) < FGPropulsion (engines, propellers, etc.) < FGMassBalance (weight and balance) < FGAerodynamics (aerodynamic effects) < FGInertial (Coriolis acceleration, etc.) < FGGroundReactions (landing gear, contact points) < FGAircraft (aircraft model as a whole) < FGTranslation (translational motion) < FGRotation (rotational motion) < FGPosition (integrates velocities to get position) < FGAuxiliary (various additional calculations) < FGOutput (provides for various output features)
http://atlas.sourceforge.net/
)
"
Atlas aims to produce and display high quality charts of the world for users of FlightGear, an open source flight simulator. This is achieved through two main parts: The map creator (simply called Map) and the Atlas viewer."
-L /usr/local/lib
to Makefile
http://www.flightgear.org/Docs/FAQ.shtml#2.6
FlightGear/data/AtlasPalette
and added
Colour 22 0.275 0.906 0.275 1.0 Colour 23 0.375 0.906 0.275 1.0 Colour 24 0.275 0.906 0.175 1.0 Colour 25 0.175 0.906 0.175 1.0 Colour 26 0.175 0.175 0.875 1.0and
Material ShrubCover 22 Material DeciduousBroadCover 23 Material EvergreenBroadCover 24 Material GrassCover 25 Material IrrCropPastureCover 25 Material IntermittentStream 26
mkdir c:/cxh/src/FlightGear/data/Atlas Map --verbose --lat=40.65167 --lon=-119.35417 --fgroot=c:/cxh/src/FlightGear/ data --atlas=c:/cxh/src/FlightGear/data/Atlas
mkdir c:/cxh/src/FlightGear/data/Atlas/lowres $ Map --size=64 --verbose --lat=40.65167 --lon=-119.35417 --fgroot=c:/cxh/src/F lightGear/data --atlas=c:/cxh/src/FlightGear/data/Atlas/lowres
Airport/default
file can
be ignored. That file was removed from CVS, but Atlas has not been
updated.
Start up Atlas:
Atlas --lat=40.65167 --lon=-119.35417 --fgroot=c:/cxh/src/FlightGear/data --udp=5500Start up FlightGear
fgfs --lat=40.65167 --lon=-119.35417 --fg-root=. --aircraft=ufo --nmea=socket,out,0.5,127.0.0.1,5500,udpWhile
fgfs
is running with --nmea, it produces
the following output on stdout
$GPRMC,164608,A,4017.704,N,11836.347,W,3887.7,-286.4,1901104,0.000,E*4F $GPGGA,164608,4017.704,N,11836.347,W,1,,,4101,F,,,,*0D $GPRMC,164610,A,4018.619,N,11834.431,W,3887.7,-321.7,1901104,0.000,E*4F $GPGGA,164610,4018.619,N,11834.431,W,1,,,10370,F,,,,*33
http://www.flightgear.org/Docs/InstallGuide/getstartch2.html#x6-110002.1
Detailed Cygwin installation instructions
ftp://ftp.sunsite.org.uk/sites/ftp.flightgear.org/flightgear-ftp/Source/
FlightGear-0.9.6.tar.gz
and did
cd c:/cxh/src/fg cat c:/tmp/downloads/flightgear/flightgear-0.9.6.tar.gz | tar -zxf -
http://reality.sgi.com/opengl/glut3/glut3.html
http://www.opengl.org/resources/libraries/glut/glut_downloads.html?glut#first_hit
I grabbed Glut3.7
bash-2.05b$ ls c:/cygwin/lib/w32api/libglut* c:/cygwin/lib/w32api/libglut.a c:/cygwin/lib/w32api/libglut32.aSo, no need to rebuild Glut! (8/05) I had to install opengl-1.1.0-6 because opengl-1.1.0-7 did not have
/usr/include/GL/gl.h
, which is needed for
plib below.
http://plib.sourceforge.net/index.html
PLIB is comprised of a number of semi-autonomous libraries that you can pretty much mix and match - using as much or as little PLIB as you need. The components libraries are:Obtain Plib
cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/plib login cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/plib co -P plib
http://plib.sourceforge.net/dist/plib-1.8.3.tar.gz
configure
, but had problems with the compiler.
Turns out that updating Cygwin for OpenGL installed a new version of gcc, but g++ was not installed.
cp c:/cygwin/usr/share/automake-1.9/install-sh . cp c:/cygwin/usr/share/automake-1.9/depcomp . cp c:/cygwin/usr/share/automake-1.9/config.guess . cp c:/cygwin/usr/share/automake-1.9/config.sub . cp c:/cygwin/usr/share/automake-1.9/missing aclocal automake autoconfNote:
automake --add-missing
might copy the files for us
./configure make >& make.out & make install
In file included from ul.cxx:25: ul.h:113: windows.h: No such file or directory ul.h:114: mmsystem.h: No such file or directory ul.h:115: regstr.h: No such file or directoryI was accidentally compiling with gcc-2.95.3. Instead, I should use gcc-3.4.4.
http://www.simgear.org
I chose simgear-0.3.8, which is required by FlightGear 0.9.8
SimGear is a set of open-source libraries designed to be used as building blocks for quickly assembling 3d simulations, games, and visualization applications.SimGear is a relatively new project, and while quite a bit of code has been written in conjunction with the FlightGear project, the final interface and arrangements are still evolving.
The term "Simulation Kernel" is a bit presumptuous for us at this point, but this is the direction we are heading with SimGear.
http://www.openal.org
http://mail.flightgear.org/pipermail/flightgear-devel/2004-September/030776.html
says to get
ftp://ftp.ihg.uni-duisburg.de/FlightGear/Win32/openal_cyg.tgz
cat c:/tmp/downloads/flightgear/openal_cyg.tgz | tar -zxvf -
Old instructions:
http://www.seedwiki.com/wiki/Flight%20Gear/MinGW/cross-compiler%20writeup.htm?wpid=143946
says that OpenAL can't easily be compiled with Cygwin and suggests
downloading
http://plausible.org/andy/fgfs-mingw-libs.tar.gz
(but that is for Mingw?) I downloaded it, untared it and did:
cd c:/cygwin/usr cat /cygdrive/c/tmp/downloads/flightgear/openal.tar | tar -xvf -Note that for versions of SimGear before SimGear-0.3.8, I used to cd to c:/cygwin/usr/local, but since this machine now has the Cygwin X11 libraries, it seems I need to cd to c:/cygwin/usr/X11R6.
SimGear-0.3.8: Actually, we need to install in c:/cygwin/usr because we need to configure Simgear without Cygwin X11R6 (see below)
I also installed the OpenAL Windows Runtime.
cd ../SimGear-0.3.8 ./configure make >& make.out &
Making all in ephemeris make[3]: Entering directory `/cygdrive/c/cxh/src/fg/SimGear-0.3.8/simgear/ephemeris' if g++ -DHAVE_CONFIG_H -I. -I. -I../../simgear -I../.. -I/usr/X11R6/include -g -O2 -D_REENTRANT -MT ephemeris.o -MD -MP -MF ".deps/ephemeris.Tpo" -c -o ephemeris.o ephemeris.cxx; \ then mv -f ".deps/ephemeris.Tpo" ".deps/ephemeris.Po"; else rm -f ".deps/ephemeris.Tpo"; exit 1; fi In file included from /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/vector:72, from ../../simgear/math/sg_types.hxx:40, from ../../simgear/misc/sg_path.hxx:36, from ../../simgear/ephemeris/stardata.hxx:31, from ephemeris.hxx:45, from ephemeris.cxx:28: /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_bvector.h: In member function `void std::vector<bool, _Alloc>::_M_insert_range(std::_Bit_iterator, _ForwardIterator, _ForwardIterator, std::forward_iterator_tag)': /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_bvector.h:522: error: expected unqualified-id before '(' token /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_bvector.h: In member function `void std::vector<bool, _Alloc>::_M_fill_insert(std::_Bit_iterator, size_t, bool)': /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_bvector.h:823: error: expected unqualified-id before '(' tokenThis is probably a min/max definition problem, see
http://www.mail-archive.com/gcc-bugs@gcc.gnu.org/msg127560.html
http://www.mail-archive.com/flightgear-devel@flightgear.org/msg34535.html
suggests not compiling with gcc-3.4.4
The problem is that
c:/cygwin/usr/include/w32api/windef.h
has:
#ifndef NOMINMAX #ifndef max #define max(a,b) ((a)>(b)?(a):(b)) #endif #ifndef min #define min(a,b) ((a)<(b)?(a):(b)) #endif #endifSo, the solution is to define NOMINMAX when compiling
simgear/sound
, I got errors
about openal, so I edited Makefile
and changed
openal_LIBS = -lalut -lwinmm -ldsound -ldxguid -lole32to
openal_LIBS = -L/usr/local/lib -lopenal32 -lalut -lwinmm -ldsound -ldxguid -lole32
make make install
make[5]: Entering directory `/cygdrive/c/cxh/src/fg/SimGear-0.3.8/simgear/scene/sky/clouds3d' if gcc -DHAVE_CONFIG_H -I. -I. -I../../../../simgear -I../../../.. -I/usr/X11R6/include -g -O2 -D_REENTRANT -MT extgl.o -MD -MP -MF ".deps/extgl.Tpo" -c -o extgl.o extgl.c; \ then mv -f ".deps/extgl.Tpo" ".deps/extgl.Po"; else rm -f ".deps/extgl.Tpo"; exit 1; fi In file included from extgl.c:85: extgl.h:363: error: 'glBlendColor' redeclared as different kind of symbol /usr/X11R6/include/GL/gl.h:1652: error: previous declaration of 'glBlendColor' was hereI tried editing simgear/scene/sky/Makefile and comment out
SUBDIRS=clouds3dbut then compiling FlightGear-0.9.8 later failed.
http://www.mail-archive.com/flightgear-devel@flightgear.org/msg10002.html
suggests uninstalling Cygwin X-windows
mv c:/cygwin/usr/X11R6 c:/cygwin/usr/X11R6.bak ./configure
Simgear configure reported openAL was missing, so I did
cd c:/cygwin/usr cat /cygdrive/c/tmp/downloads/flightgear/openal.tar | tar -xvf -
Continue with
make clean make make install
cd ../FlightGear-0.9.8 ./configure make >& make.out &
g++ -g -O2 -o test-up.exe test-up.o -lsgmath -lsgdebug -lplibsg -lplibul /usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/../../../../i686-pc-cygwin/bin/ld: cannot find -lsgmath
http://www.mail-archive.com/flightgear-users@flightgear.org/msg05226.html
suggests that
/usr/local/lib/libsgmath.a
is not being found.
I edited FlightGear-0.9.3/tests/Makefile
and added -L/usr/local/lib
test_up_LDADD = -L/usr/local/lib -lsgmath -lsgdebug -lplibsg -lplibul $(base_LIBS)
make
, same problem occurred in src/Airports
make
, same problem occurred in src/FDM/YASim
make
, same problem occurred in src/Navaids
make
, same problem occurred in src/Main
make install
c:/Program Files/FlightGear/
cd /usr/local/lib ln -s c:/Program*/FlightGear FlightGear
cd ~/src/fg/FlightGear-0.9.6/src/Main ./runfgfsor
/usr/local/bin/fgfs --fg-root=/usr/local/lib/FlightGear --enable-auto-coordinationOr
fgfs --fg-root=/cygdrive/c/cxh/src/FlightGearor
fgfs --fg-root="/usr/local/lib/FlightGear" --aircraft=ufo --timeofday=noon --log-level=info --lat=40.75 --lon=-119.23 --disable-clouds --disable-clouds3d --fog-disable
Fatal error: Failed to buffer data. (received from )The problem was OpenAL, I installed
openal_cyg.tgz
above, reconfigure SimGear, cleaned, rebuilt and installed SimGear, reconfigured, cleaned, rebuilt and installed FlightGear.
http://baron.flightgear.org/pipermail/flightgear-flightmodel/2004-January/002646.html
:
> Hello. I've just recently found out about FlightGear. I'm interested in > adding a new flight model to it. My bachelor's thesis was the flight > equations for a general aviation light aircraft flight simulator. I > would like to try to implement them into FlightGear. I've started > sifting through the source code, but if someone could give me some > pointers in the right direction it would be very helpful. In particular, > any help in identifying what the interface is between the flight model > and the rest of the FlightGear simulator would be very much appreciated.Alex:
Look at one of the FGInterface derivative classes, either FGJSBSim, or FGYasim for starters.
Is your thesis online anywhere?
You could also peruse the www.JSBSim.org site - we've got lots of FDM related material there.
http://www.jsbsim.org/
JSBSim is an open source flight dynamics model (FDM) that compiles and runs under many operating systems, including Microsoft Windows, Apple Macintosh, Linux, IRIX, Cygwin (Unix on Windows), etc. The FDM is essentially the physics/math model that defines the movement of an aircraft under the forces and moments applied to it using the various control mechanisms and from the forces of nature. JSBSim has no native graphics. It can be run by itself as a standalone program, taking input from a script file and various aircraft configuration files; or, it can be run as an integrated part of a larger flight simulator implementation that includes a visual system. The most notable example of the use of JSBSim is currently seen in the open source FlightGear simulator. JSBSim models the aerodynamic forces and moments by the classic coefficient buildup method.
src/FDM/JSBSim
looks interesting
src/FDM/ExternalPipe/ExternalPipe.cxx
is
a pipe interface to an external flight dynamics model
Section 1.4 below says
It is even possible to drive Flight Gear's scene display using an external FDM running on a different computer - although this might not be a setup recommended to people just getting in touch with FlightGear.
site:baron.flightgear.org External FDM
--fdm=abcd Select the core flight model. Options are jsb, larcsim, yasim, magic, balloon, external, ada, null. Default value is jsb (JSBSim). larcsim is the flight model which FlightGear inherited from the LaRCSim simulator. yasim is Any Ross Yet Another Flight Dynamics Simulator. Magic is a slew mode (which drives the UFO aircraft). Balloon is a hot air balloon. External refers to remote control of the simulator. Null selects no flight dynamics model at all. The UIUC flight model is not chosen this way but via the next option! For further information on flight models cf. Section ;1.4 and below.
http://baron.flightgear.org/pipermail/flightgear-users/2002-August/001502.html
says
The file 'src/Network/net_fdm.hxx' defines the data structure you will > have to send.
http://baron.flightgear.org/pipermail/flightgear-devel/2002-September/011846.html
Some of the benefits of running the FDM portion as a standalone app separate from flight gear are:
- you can kill and restart the fdm portion without restarting FG.
- you can change/recompile/rerun the fdm portion without restarting FG.
- when developing the fdm portion, you don't need to spend the overhead of compiling/linking with FG and starting FG from scratch.
- you can interface non-GPL'd flight dynamics code via this mechanism.
- you can run the FDM on a separate machine/OS, separate CPU, you could even develop it in a different computer language.
http://www.u-dynamics.com/aerosim/default.htm
Commercial Matlab/Simulink
block libraries for UAVs - freely available to non-commercial users
Hmm, looks like ssgLoadMDL might have what we need?
http://cvs.sourceforge.net/viewcvs.py/plib/plib/src/ssg/ssgLoadMDL.cxx
says:
Revision 1.49 - (download), view (text) (markup) (annotate) - [select for diffs]
Mon Dec 8 08:22:12 2003 UTC (5 months, 1 week ago) by wolfram_kuss
Changes since 1.48: +370 -184 lines
Diff to previous 1.48Implemented the most important commands for CFS2 and FS2k2 files (includign "functionality").
Split off some functions for better readability
As of 5/20/04, it seemed like the cvs site was down?
The commands to obtain:
cvs -d:pserver:anonymous@cvs.prettypoly.sourceforge.net:/cvsroot/prettypoly login cvs -d:pserver:anonymous@cvs.prettypoly.sourceforge.net:/cvsroot/prettypoly co ppeTry
http://prettypoly.sourceforge.net/download/current.tgz
autoconf ./configure --enable-cygwin --enable-win9x make make installThe
--enable-win9x
configure option
is necessary to fix this problem:
Compiling Fl_Image.cxx... In file included from Fl_Image.cxx:357: win/Image.cxx: In member function `virtual void Fl_Win_Display::draw(Fl_RGB_Image*, int, int, int, int, int, int)': win/Image.cxx:103: error: `AlphaBlend' undeclared (first use this function) win/Image.cxx:103: error: (Each undeclared identifier is reported only once for each function it appears in.) make[1]: *** [Fl_Image.o] Error 1
aclocal autoconf automake --add-missing ./configure --with-python-inc=/usr/include/python2.4I had to edit configure.in and remove examples/Makefile and then rerun the above to create Makefile.in
I had to copy the fltk libraries to /usr/lib:
cp /usr/local/lib/libfl* /usr/lib
fluid
is in your path.
/usr/local/bin
to your path
or cp /usr/local/bin /usr/bin
if g++ -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"ppe\" -DVERSION=\"0.0.1\" -DHAVE_BOOL=1 -DX_DISPLAY_MISSING=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DWIN32=1 -DSTDC_HEADERS=1 -DHAVE_GL_GL_H=1 -DHAVE_GL_GLUT_H=1 -DHAVE_PNG_H=1 -DHAVE_JPEGLIB_H=1 -I. -I. -I../../src -I/usr/X11/include -g -O2 -MT image.o -MD -MP -MF ".deps/image.Tpo" -c -o image.o image.cxx; \ then mv -f ".deps/image.Tpo" ".deps/image.Po"; else rm -f ".deps/image.Tpo"; exit 1; fi In file included from /usr/include/jpeglib.h:30, from jpegimg.h:58, from image.cxx:57: /usr/include/jmorecfg.h:250: error: conflicting declaration 'typedef long int INT32' /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../include/w32api/basetsd.h:52: error: 'INT32' has a previous declaration as `typedef int INT32' /usr/include/jmorecfg.h:250: error: declaration of `typedef long int INT32' /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../include/w32api/basetsd.h:52: error: conflicts with previous declaration `typedef int INT32' /usr/include/jmorecfg.h:250: error: declaration of `typedef long int INT32' /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../include/w32api/basetsd.h:52: error: conflicts with previous declaration `typedef int INT32'Edit
/usr/include/jmorecfg.h
and #define XMD_H
or comment that code out.
LIBS = -L/lib/python2.4/config -L/usr/local/lib/python2.4/config -lpython2.4 -L/usr/local/lib -lfltk_gl -lfltk -lwsock32 -lplibfnt -lplibssgaux -lplibssg -lplibsg -lplibul -lpng -ljpeg -lm -lwinmm -lglu32 -lopengl32 -luser32 -lgdi32
default_bindings missing
. I obtained this file from
the Windows installation of ppe and did:
mkdir -p /usr/share/ppe/scripts cp ../old/ppewin/default_bindings.py !$
export CVSROOT=:pserver:anonymous@cvs.sourceforge.net:/cvsroot/fltk cvs login cvs -z9 get -d fltk-1.2.x -r v1_2 fltk
strcasecmp
errors
:\cxh\src\fltk-1.2.x\src\filename_list.cxx(46) : error C2065: 'strcasecmp' : undeclared identifierSolution: edit flstring.g and define strcasecmp under Windows
# if defined(__APPLE__) && defined(__MWERKS__) && defined(_MSL_USING_MW_C_HEADERS) int strcasecmp(const char*,const char*); int strncasecmp(const char*,const char*,int); char *strdup(const char*); # else defined(WIN32) && ! defined (CYGWIN) #define strcasecmp(s1,s2) stricmp(s1,s2) # endif
mkdir c:/Program\ Files/Microsoft\ Visual\ Studio/VC98/Include/ppe
ppe/msvc/copy_plib_headers.bat
and change
the location of plib/
to plib-1.8.3/
cmd
, then
invoke ppe\msvc\copy_plib_headers.bat
cp c:/cxh/src/plib-1.8.3/src/ssg/ssgconf.h c:/Program\ Files/Microsoft\ Visual\ Studio/VC98/Include/plib/Also missing:
cp c:/cxh/src/plib-1.8.3/src/ssgAux/ssgaParticleSystem.h !$ cp c:/cxh/src/plib-1.8.3/src/ssgAux/ssgaFire.h !$ cp c:/cxh/src/plib-1.8.3/src/ssgAux/ssgaWaveSystem.h !$ cp c:/cxh/src/plib-1.8.3/src/ssgAux/ssgaLensFlare.h . cp c:/cxh/src/plib-1.8.3/src/ssgAux/ssgaScreenDump.h .
c:\cxh\src\ppe,c:\cxh\src\ppe\src,C:\cygwin\usr\include\Python2.3,c:\Program Files\microsoft visual studio\vc98\include\ppe,C:\cxh\src\fltk-1.2.x,C:\cxh\src\plib-1.8.0
python.h
from Cygwin, which
includes unistd.h
ppeEventHandler.obj : error LNK2001: unresolved external symbol "public: void __thiscall Fl_Gl_Window::make_current(void)" (?make_current@Fl_Gl_Window@@QAEXXZ)Solution: build fltkgld.lib by opening fltk-1.2.x/visualc/fltkgl.dsw and build it, then add fltk-1.2.x/lib/fltkgld.lib to ppe libs
--------------------Configuration: ppe - Win32 Debug-------------------- Linking... MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _toupper already defined in LIBCD.lib(toupper.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _tolower already defined in LIBCD.lib(tolower.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _isupper already defined in LIBCD.lib(_ctype.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _isalpha already defined in LIBCD.lib(_ctype.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _realloc already defined in LIBCD.lib(dbgheap.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _free already defined in LIBCD.lib(dbgheap.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _malloc already defined in LIBCD.lib(dbgheap.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _isspace already defined in LIBCD.lib(_ctype.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _strchr already defined in LIBCD.lib(strchr.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _isalnum already defined in LIBCD.lib(_ctype.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _memmove already defined in LIBCD.lib(memmove.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _isdigit already defined in LIBCD.lib(_ctype.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _isxdigit already defined in LIBCD.lib(_ctype.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _strncmp already defined in LIBCD.lib(strncmp.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _strrchr already defined in LIBCD.lib(strrchr.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _sprintf already defined in LIBCD.lib(sprintf.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _floor already defined in LIBCD.lib(floor.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _strtol already defined in LIBCD.lib(strtol.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _strtod already defined in LIBCD.lib(strtod.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _sscanf already defined in LIBCD.lib(sscanf.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: __isctype already defined in LIBCD.lib(isctype.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _exit already defined in LIBCD.lib(crt0dat.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _getenv already defined in LIBCD.lib(getenv.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _strstr already defined in LIBCD.lib(strstr.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _isprint already defined in LIBCD.lib(_ctype.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _fclose already defined in LIBCD.lib(fclose.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _fread already defined in LIBCD.lib(fread.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _fopen already defined in LIBCD.lib(fopen.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _qsort already defined in LIBCD.lib(qsort.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _calloc already defined in LIBCD.lib(dbgheap.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _atoi already defined in LIBCD.lib(atox.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _atof already defined in LIBCD.lib(atof.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _strcspn already defined in LIBCD.lib(strcspn.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _fgets already defined in LIBCD.lib(fgets.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _fprintf already defined in LIBCD.lib(fprintf.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _fputc already defined in LIBCD.lib(fputc.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _fwrite already defined in LIBCD.lib(fwrite.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _bsearch already defined in LIBCD.lib(bsearch.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _islower already defined in LIBCD.lib(_ctype.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: __stricmp already defined in LIBCD.lib(stricmp.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: __getcwd already defined in LIBCD.lib(getcwd.obj) MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: __stat already defined in LIBCD.lib(stat.obj) LINK : warning LNK4098: defaultlib "MSVCRTD" conflicts with use of other libs; use /NODEFAULTLIB:library ppeCoreFuncs.obj : error LNK2001: unresolved external symbol __imp___Py_RefTotal ppeViewFuncs.obj : error LNK2001: unresolved external symbol __imp___Py_RefTotal pythonInterface.obj : error LNK2001: unresolved external symbol __imp__Py_InitModule4TraceRefs fltkd.lib(Fl_x.obj) : error LNK2001: unresolved external symbol __imp___TrackMouseEvent@4 Debug/ppe.exe : fatal error LNK1120: 3 unresolved externals Error executing link.exe. ppe.exe - 47 error(s), 1 warning(s)
http://curl.haxx.se/mail/lib-2002-09/0125.html
suggests recompiling
using /MD
Get rid of trackmouse warning by editing fltk-1.2.x/src/Fl_win32.cxx and commenting out the define:
// // USE_TRACK_MOUSE - define it if you have TrackMouseEvent()... // // Apparently, at least some versions of Cygwin/MingW don't provide // the TrackMouseEvent() function. You can define this by hand // if you have it - this is only needed to support subwindow // enter/leave notification under Windows. // //#define USE_TRACK_MOUSE #if !defined(__GNUC__) //# define USE_TRACK_MOUSE #endif // !__GNUC__
Missing python symbols
ppeCoreFuncs.obj : error LNK2001: unresolved external symbol __imp___Py_RefTotal ppeViewFuncs.obj : error LNK2001: unresolved external symbol __imp___Py_RefTotal pythonInterface.obj : error LNK2001: unresolved external symbol __imp__Py_InitModule4TraceRefsSolution: Download Python sources and recompile
http://www.flightgear.org/Docs/FAQ.shtml#6.5
6.5 - How do I import BGL scenery from Microsoft Flight Simulator?However, that site is missing.
http://web.archive.org/web/20021208104536/chiangt.virtualave.net/BGL/bgl_index.html
- The archive.org listing
from 12/08/2002 looks much like what is below.
http://matrixsoft.50megs.com/BGL/
eventually gets redirected to:
http://www.geocities.com/tengchiangtsao/ is reproduced below.
I've indented the original text and added my comments.
The developer docs can be found below.
Adding www.flightsim.com's Scenery to FlightGear flight simulator
Hi folks,For developers, please come here.
ppe is the PrettyPoly Editor. The tar file above includes
Otherwise, follow the following steps. This version of ppe can convert .bgl models to generic .ssg models. It already statically linked my modified verion of plib. 1. Download ppe
.tar.gz and do tar -xzf ppe.tar.gz
ppe/src/ppe
, which is a linux binary.
To install ppe it, you will need OpenGL, Python, FLTK and Plib See the plib notes above.
To install Python, get it from Cygwin setup.
./configure
I used this:
2. Download textures.zip and extract to /usr/local/lib/FlightGear/Textures or wherever we like.
3. Do this before running ppe only if you use PATH or full path name to run ppe instead of running PPE from it's install directory.
export PPE_ROOT=/where/we/put/my-version/of/ppeOtherwise python will complain default_bindings problems.4. Rename the *.bgl file that we want to convert to *.mdl
files=*.bgl for file in $files do mv $file `basename $file .bgl `.mdl done
I ran scdis on brc.bgl, which reported:
5. Goto /where/we/put/my-version/of/ppe . Modify the first line of ppe to correctly point to shell interperter. Then, do
./ppe6. Now, when we open the .bgl model (actually renamed to *.mdl already) in PPE we may not be able to see the texture because I hard coded the input texture's directory to /usr/local/lib/FlightGear/Textures (we may make a symbolic link to see the textures, any ways). I will improve this later.
7. But the most important thing is to setup the *.ssg model's output texture directory correctly. If we didn't do the previous step right but set up this thing correctly, the final product is still good.
Goto the small model editor window of PPE, select "Edit"->"Preference" and enter the texture path (see step 2).8. Now look at the big window of PPE (where our model is rendered), if we are happy with the scene, we are ready to output the *.ssg file. Otherwise, manually edit the scene (I don't know how to do this though).
9. Goto the "File"->"Save As" menu, and enter the file name with a ".ssg" extension. PPE will convert the file to ssg format. I found SSG format is the best for FlightGear.
10. Here comes the hard part. We need to feagure out where the scene is located. For example, Boston is located in w072n42 (/usr/local/lib/FlightGear/Scenery/w080n40/w072n42). Some tourist maps from "Barn's And Novel" or CVS drug store may help. : )
11. Not done yet. Make a *.stg file that has a line like the following: OBJECT_STATIC boston.ssg -71.08 42.30 0 0 If the file already exists, append this line to the end.
12. To learn how to calculate the * magic number, please visit Cameron Moore's FG FAQ[6.5]. The FAQ is shipped with FlightGear base package. (FlightGear/Docs/FlightGear-FAQ.html)
For me, i used to fly to where i want to put the city and write down the (lon,lat), for example, Boston is (-71.08, 42.30) and then start Fgfs again with the (lon,lat) as command line option like this: fgfs --lat=42.30 --lon=-71.08 2>&1 | tee fgfs.log
;max north: N40:45:38.97 ;min north: N40:44:41.43 ;max east: W119:14:6.60 ;min east: W119:14:6.60So, I would run
fgfs --lat=40.75 --lon=-119.23 --log-level=info
http://www.flightgear.org/Docs/FAQ.shtml#2.6
And then used the FlightGear Scenery Installer
(Start -> All Programs -> FlightGear v 0.9.6 -> Install & Uninstall Scenery)
to install the scenery
c:/Program\ Files/FlightGear/data/Scenery/Objects cat c:/tmp/downloads/flightgear/w120n40.tar.gz | tar -zxf -I appended
OBJECT_STATIC 2002faces.ssg -119.23 40.75 1189 0 OBJECT_STATIC 2003gravity.ssg -119.23 40.75 1189 0 OBJECT_STATIC 2004handofgod.ssg -119.23 40.75 1189 0 OBJECT_STATIC brc1.ssg -119.23 40.75 1189 0 OBJECT_STATIC brc2.ssg -119.23 40.75 1189 0 OBJECT_STATIC brcplan.ssg -119.23 40.75 1190 0 OBJECT_STATIC contessa.ssg -119.23 40.75 1189 0 OBJECT_STATIC duckybar.ssg -119.23 40.75 1189 0 OBJECT_STATIC plastic_chapel.ssg -119.23 40.75 1189 0 OBJECT_STATIC testwow.ssg -119.23 40.75 1189 0These have problems
OBJECT_STATIC 2003honor.ssg -119.23 40.75 1189 0 OBJECT_STATIC centercamp1.ssg -119.23 40.75 1189 0 OBJECT_STATIC centercamp2.ssg -119.23 40.75 1189 0 OBJECT_STATIC 2003man.ssg -119.23 40.75 1189 0to
: c:/Program Files/FlightGear/data/Scenery/w120n40/w120n40/991419.stg
(The 1189
is the height in meters)
Then, open fgfs.log with a text editor and find the keyword "Loading tile" At the end of the line of the first "Loading title" is the magic number. For Boston, it is about 1777947. Note: the FAQ says *.ind, but we use *.stg in FlightGear 0.7.9
13. Finally, put the *.stg file and *.ssg file in the scenery location directory. For Boston, I put 1777947.stg and boston.ssg in /usr/local/lib/FlightGear/Scenery/w080n40/w072n42
http://www.geocities.com/tengchiangtsao/developers.html
cvs -d:pserver:anonymous@cvs.prettypoly.sourceforge.net:/cvsroot/prettypoly login cvs -d:pserver:anonymous@cvs.prettypoly.sourceforge.net:/cvsroot/prettypoly co ppe
Hi developers,ssgLoadBGL.cxx is being developed. It is based on ssgLoadMDL.cxx. An newest alpha version of it . Demo scenery in this page are Stuttgart and Boston.
Procedure :
1.Make sure we have the newest PPE from cvs and the PPE works fine for normal .mdl models . *
As of 5/20/04, it seemed like the cvs site was down?
As of 2/04, the cvs version of ppe uses fltk-1.2.x, not fltk-2.0. If you try to compile with fltk-2.0, you will get:
thumbnail.h:55:25: FL/Fl_Image.H: No such file or directoryppe requires automake, so we install it using Cygwin setup
rm -f config.* aclocal automake -a autoconf ./fluidizer.py ./configureConfigure could not find python, I did:
./configure --with-python-inc=/usr/include/pythonConfigure barfed with
configure: error: conditional "ENABLE_XMESA_FX" was never defined. Usually this means the macro was only invoked conditionally.
http://baron.flightgear.org/pipermail/flightgear-users/2002-October/002285.html
said:
< dnl AM_CONDITIONAL(ENABLE_XMESA_FX, test "no" = "yes") --- > AM_CONDITIONAL(ENABLE_XMESA_FX, test "no" = "yes")I ended up with:
if test "x$ac_cv_lib_MesaGL_glNewList" = "xyes" ; then AC_CHECK_HEADER(GL/xmesa.h) dnl AM_CONDITIONAL(ENABLE_XMESA_FX, dnl test "x$ac_cv_header_GL_xmesa_h" = "xyes") else dnl force a failed check dnl AM_CONDITIONAL(ENABLE_XMESA_FX, test "no" = "yes") echo "force a failed check for XMESA?" fi
makeFailed with:
In file included from madGUI.h:5, from madGUI.cxx:3: thumbnail.h:55:25: FL/Fl_Image.H: No such file or directoryFL/Fl_Image.H is from Fltk-1.2. So, in 2/04, the cvs version of ppe requires Fltk-1.2, not Fltk-2.0.
For instructions on downloading Fltk-1.2, see
http://www.fltk.org/software.php?SOFTWARE=v1_2
export CVSROOT=:pserver:anonymous@cvs.fltk.sourceforge.net:/cvsroot/fltk cvs login (press ENTER when asked for a password) cvs -z3 get -rv1_2 -d fltk-1.2.x fltk cd fltk-1.2.x autoconf ./configure make >& make.out & make installBack to making ppe:
In file included from madGUI.h:19, from madGUI.cxx:3: colorbutton.h: In member function `virtual void ColorButton::draw()': colorbutton.h:86: error: `down' undeclared (first use this function) colorbutton.h:86: error: (Each undeclared identifier is reported only once for each function it appears in.) make[3]: *** [madGUI.o] Error 1Looks like ppe is dated from January, 2001, so I tried fltk-1.0.11, which is from
cd fltk-1.0.11 autoconfconfigure failed, so I did
configure --without-xwhich also did not work, so I tried fltk-1.1.4
cd fltk-1.1.4 ./configure makeAww, to heck with it. fltk-1.1.4/CHANGES says
- Renamed down() and frame() to fl_down() and fl_frame(), filename_xyz() to fl_filename_xyz(), and all of the define_FL_FOO() functions for the custom boxtypes to fl_define_FL_FOO() to avoid namespace clashes.So, I changed
ppe/src/material/colorbutton.h
from
down(
to fl_down(
madscantree.cxx: In member function `void Mad::scanLibrary()': madscantree.cxx:172: error: `filename_list' undeclared (first use this function) madscantree.cxx:172: error: (Each undeclared identifier is reported only once for each function it appears in.) madscantree.cxx:176: error: `filename_match' undeclared (first use this
filename_list
-> fl_filename_list
filename_match
-> fl_filename_match
Ditto with madfile.cxx
and mad.cxx
While compiling in ppe/src/gui
ppeGUIFuncs.cxx:53:20: Python.h: No such file or directory In file included from ppeGUIFuncs.cxx:54: ../../src/ppeFuncs.h:52: error: type specifier omitted for parameter `PyObject' ../../src/ppeFuncs.h:52: error: syntax error before `*' token ppeGUIFuncs.cxx:74: error: syntax error before `*' token ppeGUIFuncs.cxx:75: error: syntax error before `*' token ppeGUIFuncs.cxx:76: error: syntax error before `*' tokenppe/src/gui/Makefile
INCLUDES = -I$(top_srcdir)/src -I.. -I/usr/include/python -I/usr/X11/include
INCLUDES = -I$(top_srcdir)/src -I.. -I/usr/include/python2.3 -I/usr/X11/includeIt happened again in src/core, so I did
cd /usr/include ln -s python2.3 python
In ppe/src/core:
ppeCoreFuncs.cxx: In function `PyObject* ppePyHookMergeHNodes(PyObject*, PyObject*)': ppeCoreFuncs.cxx:1724: error: `mergeHNodes' undeclared (first use this function) ppeCoreFuncs.cxx:1724: error: (Each undeclared identifier is reported only oncemergeHNodes probably comes from plib/ssg.h
Solution: comment it out:
PYTHONFUNC(ppePyHookMergeHNodes) printf("ppePyHookMergeHNodes: no mergeHNodes"); // PYTHON_FUNC_START_NO_ARG //curr_viewer->getSceneRoot()->mergeHNodes(); curr_viewer -> changed () ; RETURN_NOTHING ; }Problem:
ppeWalkScene.cxx: In function `void removeDuplicateNodes()': ppeWalkScene.cxx:541: error: `compare' undeclared (first use this function) ppeWalkScene.cxx:541: error: (Each undeclared identifier is reported only once for each function it appears in.)Solution: that method is unused, comment the body out. Problems with misc/image.cxx
In file included from /usr/include/c++/3.3.1/bits/locale_facets.tcc:43, from /usr/include/c++/3.3.1/locale:47, from /usr/include/c++/3.3.1/bits/ostream.tcc:37, from /usr/include/c++/3.3.1/ostream:535, from /usr/include/c++/3.3.1/iostream:45, from image.cxx:54: /usr/include/c++/3.3.1/limits:205:22: macro "min" requires 2 arguments, but only 1 givenSolution: Move the iostream.h include to before the image.h include
edit jmorecfg.h and comment out
#ifndef XMD_H /* X11/xmd.h correctly defines INT32 */ //typedef long INT32; #endif
Problems finding python2.4
cannot find -lpython2.4Edit src/Makefile and change
-L/usr/lib/python2.1/configto
-L/lib/python2.4/config
Problems linking:
ppe.o(.text+0xd4e): In function `main': /cygdrive/c/cxh/src/ppenew/ppe/src/ppe.cxx:445: undefined reference to `Fl::gl_visual(int, int*)' ../src/gui/libppegui.a(ppeEventHandler.o)(.text+0x926): In function `_ZN15ppeEventHandler6handleEiP9ppeViewer':Solution: added -lfltk_gl, -lpng, -ljpeg
LIBS = -L/lib/python2.3/config -L/usr/local/lib/python2.1/config -lpython2.3 -L/usr/local/lib -lfltk_gl -lfltk -lwsock32 -lplibfnt -lplibssgaux -lplibssg -lplibsg -lplibul -lpng -ljpeg -lm -lwinmm -lglu32 -lopengl32 -luser32 -lgdi32 LTLIBOBJS =
Problems with _ctype in fltk, edited fltk-1.1.4/src/makeinclude and removed -mno-cywin, recompiled fltk
Problem with filename_list.cxx:
filename_list.cxx: In function `int fl_filename_list(const char*, dirent***, int (*)(dirent**, dirent**))': filename_list.cxx:54: error: invalid conversion from `int (*)(const dirent**, const dirent**)' to `int (*)(dirent**, dirent**)'Solution: remove the consts
Problem with DoDragDrop and OleInitialize in fltk-1.1.4
Solution: comment it out.
ppeScene::load_database(ssgBranch*) is not defined?
Solution: edit the src/Makefile and put core/libppecore.a at the end of ppe_LDADD
g_nolods undefined:
//extern int g_noLoDs; getBuilder() -> countGeometry ( obj, /*g_noLoDs*/ 1);
The binary would start, but the menus did not work, so I tried fltk-1.2, plib-1.6.0, ppe
Problem: RegisterDragDrop undefined
fl_dnd_win32.cxx: don't include drag and drop
Problem
Fl_win32.cxx: comment out ifdef(GNUC) sections (3 places)
FINALLY, ppe compiles!
To run it, I did
export PPE_ROOT=c:/cxh/src/ppe /usr/local/bin/ppeThe menus work!
2.Copy the ssgLoadMDL.cxx file to our plib installation area and overwrite our original ssgLoadMDL.cxx.
I did:
gunzip c:/tmp/downloads/SsgLoadMDL.cxx cd plib-1.6.0 cp src/ssg/ssgLoadMDL.cxx src/ssg/ssgLoadMDL.cxx.orig cp c:/tmp/downloads/SsgLoadMDL.cxx src/ssg/ssgLoadMDL.cxx
3.Rebuild our plib. Reinstall plib. **
./configure makeGot:
LoadMDL.cxx:1957: error: `fsTexPalette' undeclared (first use this function)Solution: change it to ssgFsTexPalette
texels[c++] = ssgFsTexPalette[b*4 ]; texels[c++] = ssgFsTexPalette[b*4 + 1]; texels[c++] = ssgFsTexPalette[b*4 + 2]; texels[c++] = ssgFsTexPalette[b*4 + 3];
4.Rebuild our PPE. Reinstall PPE. ***
5.Find the .bgl file that we want to convert to .ssg.
6.Rename the *.bgl file to *.mdl
7.Open the renamed *.mdl file in PPE
8.In PPE menu, use "save as" to save the file as a .ssg file
9.In FG 0.7.8, we need to put a line in a .stg file like this: *.ssg in the Scenery directory of FG. The loader is still named ssgLoadMDL.cxx, Should we rename it? Also please rename our .bgl scenery to .mdl before testing this loader. Basically, plib doesn't know what ssgLoadBGL.cxx is yet. So we pretend we are loading mdl models right now.
The trick to build PPE is to manually run the fluidizer.py script. Without manually run the script, configure may fail in several jpeg or png libraries. We may think those libs we can ignore, but we will completely fail when compiling. The fluidizer.py script is shiped with ppe.
** The trick of rebuilding plib is NOT to make clean after replacing ssgLoadMDL.cxx. Instead, do a "make". GNU make will only recompile the ssgLoadMDL.cxx. Then do "make install" to install the new plib.
*** The trick of rebuilding ppe is NOT to do "make", NOR "make claen". Instead, do the following: g
$ cd <ppe>/<src>/ $ c++ -g -O2 -O6 -Wall -o ppe ppeMad.o ppe.o ../src/gui/libppegui.a ../src/viewer/libppeviewer.a ../src/core/libppecore.a ../src/material/libppematerial.a ../src/misc/libppemisc.a ../src/fltk-extras/libppefltkextras.a ../src/structure/libppestructure.a -lpng -lz -ljpeg -L/usr/lib/python1.5/config -L/usr/local/lib/python1.5/config -lpython1.5 -lpthread -L/usr/local/lib -L/usr/X11R6/lib -lfltk -lplibfnt -lplibssgaux -lplibssg -lplibsg -lGLU -lGL -lplibul -L/usr/X11R6/lib -lSM -lICE -lX11 -lXi -lXext -lXmu -ldl -lmgcc will only "relink" ppe binaries with new plib. PPE will not be recompiled.Optionally, do
$ /usr/bin/install -c ppe /usr/local/bin/ppeTo make PPE able to adjust texture coordination for each vertex. Please replace these files in the src/structure/ directory: ppeStructureGUI.fl ppeStructureView.cxx ppeStructureView.h and do "make" with in the src/structure/ directory . Then follow the procefure of rebuilding and/or reinstalling PPE.
; BGLTST 2.50 analysing file: ; C:\cxh\src\virtualplaya\brcplan.bgl ; ID=1 40:45:59 40:44:21 -119:14:07 -119:14:07 VIS scenery sect 9 -> 80 -------- Area( C 40:45:10.1997 -119:14:06.6004 100 ) 00008A: 0018: 0: destination should be a Perspective command ! 0000A2: 32 00 0E 00 2... Error count 1 Max subroutine level 2 Qmax = 4
ssgLoadSSG - for '.ssg' files - the 'native' SSG format. ssgLoadAC - for '.ac' files - a somewhat obscure format produced by the 'AC3D' modelling tool - reasonably well tried and tested. ssgLoad3ds - for '.3ds' files as produced by 3DStudio. ssgLoadASE - 3DSMAX ASCII EXPORT Version 2.00, well tested ssgLoadDXF - AutoCADs famous DXF format. well tested ssgLoadFLT - OpenFlight. Works for OpenFlight files generated by recent versions of MultiGen - but not for those generated by some other tools such as Designers' Workbench. ssgLoadMD2 - Quake MD2 ssgLoadOBJ - Wavefront, works well ssgLoadTRI - simple Tri format from "Andy Colbournes Editor". ssgLoadX - Microsofts DirectX-Format. Most features work. ssgLoadOFF - Geomview's OFF ssgLoadM - ??? ssgLoadATG - Ascii TerraGear. Used by Flight Gear Flight Sim. ssgLoadVRML1 - VRML1 format, only partially implemented. ssgLoadIV - Inventor format, only partially implemented. ssgLoadStrip - The format of a stripifier. Flightgear-devel, 2002-July says: I just commited a new version of the BGL loader in plib. I did quite some researches on different bgl files, tried to fix some color materials issues and added some new bgl instrcutions.The most obvious enhancement is the support of ground layers. So when you load a BGL file you will see correctly piled gound layers (like asphalt on grass etc..) with no flickers anymore:) Some bgl models I found in the web actually consist of several bgl files. Each of them may contain some information about ground layers. If they where loaded seperately it may happen that ground layers of later loaded bgl files cover the previous ones which might be the wrong order. To overcome that problem I provide an new loader extension called "*.bgb". A bgb file is a simple ASCII file containing all bgl files for one modell. By using this you will store all bgl files in one ssgBranch and therefor you get a correct layering of the model. You can easily create a bgb file by
%cd <to model> %ls *.bgl > model.bgbAs result you get an ascii file with a bgl file in each line. You can load this bgb file like you did before with the bgl files, however the bgb and bgl files have to be in the in the same directory for loading.http://cvs.sourceforge.net/viewcvs.py/plib/plib/src/ssg/ssgLoadMDL_BGLTexture.cxx
CVS log for ssgLoadBGL.cxx suggests that the file was removed for legal reasons? ssg.cxx
getsssgAddModelFormat ( ".bgl", ssgLoadBGL , NULL ) ;ssg.h
getsssgEntity *ssgLoadBGL ( const char *fname, const ssgLoaderOptions *options = NULL ) ;Edit Makefile
and addssgLoadBGL.cxx
andssgLoadBGL.o
Edit ssgLoadBGL.cxx
and#define SSG_LOAD_BGL_SUPPORTEDCompile ssgLoadBGL.cxx:2447: error: brace-enclosed initializer used to initialize ` char*'Solution: Remove curly brackets:static char *textures[8] = { "sandstone.rgb", "white.rgb", "black.rgb", "darkgray.rgb", "gray.rgb", "whitehorizon.rgb", "sandstonehorizon.rgb", "gray.rgb" }; ssgLoadBGL.cxx:2509: error: brace-enclosed initializer used to initialize `int'Solution: Remove curly brackets:static int oct_faces[] = { 8|FLOOR, 7, 6, 5, 4, 3, 2, 1, 0, 4, 0, 1, 9, 8, 4, 1, 2, 10, 9, 4, 2, 3, 11, 10, 4, 3, 4, 12, 11, 4, 4, 5, 13, 12, 4, 5, 6, 14, 13, 4, 6, 7, 15, 14, 4, 7, 0, 8, 15, 8|ROOF, 8, 9, 10, 11, 12, 13, 14, 15 }; ... static int block_faces[] = { 4|FLOOR, 3, 2, 1, 0, 4, 0, 1, 5, 4, 4, 1, 2, 6, 5, 4, 2, 3, 7, 6, 4, 3, 0, 4, 7, 4|ROOF, 4, 5, 6, 7 };It links, but bash-2.05b$ ppe brc1.bgl Filename = ppe_undo_0000_XXXXXX DEBUG: [ssgLoadBGL] Reference Lat: 40.752833; Reference Lon: -119.235167 WARNING: [ssgLoadBGL] Unhandled opcode 'BGL_IFVIS' (98x) WARNING: [ssgLoadBGL] Unhandled opcode 'UNKNOWN 0xBC' (188x) FATAL: [ssgLoadBGL] Op-code out of range: 2048x0xBC
is probably BGLVERSION, which is not defined in ssgLoadBGL.cxx or ssgLoadMDL.cxx, but the note scdis2.3:Ver 2.3 2003/10/19 Suppor following commands: BGLVersion, EndVersion, MaterialList, VertexList, TextureList, DrawTriList, DrawLineList, DrawPointList, SetMaterial, VarBaseOverride, Interpolate, Transform_Mat, TransformEnd, Animate, I_A9, IfInF, ZBias.Command to rebuild cp ~/src/plib-1.7.0/src/ssg/libplibssg.a c:/cygwin/lib/libplibssg.a cd ~/src/ppe/src; make; cp ppe.exe c:/cygwin/usr/local/bin/ppe.ex
http://baron.flightgear.org/pipermail/flightgear-devel/2002-April/007106.html
says:
Interesting link. Still, I tried the MakeMDl that comes with MSFS 2002 Pro some time ago without success. The *.MDL it writes is too different, it is a new version. You might have luck with middleman, which might enable you to "intercept" the *.x file that gmax gives to MakeMDL. I did not try that.