From 3652bd9015acfeb17d3cd5ed1ab6abb5636e5b4c Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 24 Dec 2001 14:12:38 +0000 Subject: [PATCH] Various clean ups for the release. --- FAQ | 1 - INSTALL | 18 ++++- Makefile | 1 + TODO | 36 ++++++++-- doc/stereo.html | 8 +-- src/Demos/Makefile | 5 +- src/Demos/hangglide/base.cpp | 2 +- src/Demos/hangglide/sky.cpp | 2 +- src/Demos/hangglide/tank.cpp | 2 +- src/Demos/hangglide/terrain.cpp | 2 +- src/Demos/hangglide/trees.cpp | 2 +- src/Demos/osgimpostor/osgimpostor.cpp | 2 +- src/Demos/osgreflect/osgreflect.cpp | 4 +- src/Demos/osgtext/main.cpp | 12 +--- src/Demos/osgviews/osgviews.cpp | 2 +- src/Demos/sgv/sgv.cpp | 2 +- src/Makefile | 7 +- src/osg/Light.cpp | 20 +++--- src/osg/Matrix.cpp | 3 - src/osgPlugins/Makefile | 19 +++++- src/osgPlugins/pfb/ConvertFromPerformer.cpp | 76 ++++++++++----------- src/osgPlugins/pfb/ConvertToPerformer.cpp | 8 +-- src/osgPlugins/png/new_ReaderWriterPNG.cpp | 4 +- src/osgText/Font.cpp | 2 +- src/osgUtil/FlightManipulator.cpp | 2 +- src/osgUtil/RenderBin.cpp | 4 +- src/osgUtil/TrackballManipulator.cpp | 4 +- 27 files changed, 149 insertions(+), 101 deletions(-) diff --git a/FAQ b/FAQ index 48c417287..fe81bdd0c 100644 --- a/FAQ +++ b/FAQ @@ -345,5 +345,4 @@ o Is there a mailing list? o How do I submit my contributions? - We will eventually be setting up CVS access, possibly with SourceForge. Up till then send your changes, to diff --git a/INSTALL b/INSTALL index 1a10dc582..6c2476608 100644 --- a/INSTALL +++ b/INSTALL @@ -9,11 +9,21 @@ OSG has it own native ascii file format, and .rgb image reader inbuilt which allows you read the example data with any dependencies other than C++, STL and OpenGL. +The new osgText library adds the dependency of the freetype library for support +of true type fonts, however it is not essential to the core library, so you can +comment it out from compilation by modifying the src/Makefile, and src/Demos/Makefile. +I you wish to use fonts then you can download freetype from www.freetype.org. The +osgText library also requires an up to date GLU implementation which supports +GLU1.3 tessellation routines. If you your current GLU is out of date you'll need +to download the latest, for instance the sgi's sample implementation for +GLU from the www.opengl.org website. + The OSG also has a set of plug-ins which support non-native 3d database and image formats, several have no dependencies on external libraries (flt,3ds,obj, lwo,dw, tga & pic), while others (pfb,jpeg,gif,tiff) require other libraries to be installed to compile them. If you don't already have them installed then -don't worry, you'll still be able to use the OSG. The core osg library and +don't worry, you'll still be able to use the OSG, just comment out the plugins +you can't compile from the src/osgPlugins/Makefile. The core osg library and viewer has been designed to load the plug-ins at run-time only and if they are required to load a specific data set. If you don't need them for your datasets then it won't matter that you haven't been able to compile @@ -42,7 +52,7 @@ Environmental settings under Unix setenv OSGHOME setenv OSGDATA - setenv OSGFILEPATH ./:${OSGDATA}:${OSGDATA}/Images: + setenv OSGFILEPATH ./:${OSGDATA}: setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${OSGHOME}/lib setenv PATH ${PATH}:${OSGHOME}/bin @@ -221,7 +231,7 @@ Compiling under MacOS X (instructions written by Phil Atkin) Then you are in Unix land, and it's all very familiar. - You will need a .cshrc file with $OSGHOME (as in your instructions), and + You will need a .cshrc file with $OSGHOME (as above), and this is a filename that the Mac won't let you see from the Finder or in fact generate from an app, so I used vi to create that. Then I just went @@ -307,6 +317,8 @@ Running the demos or osgviews glider.osg + + To (Note: the file is picked up by checking the directories pointed to diff --git a/Makefile b/Makefile index b0e022ed4..ffbb6839c 100644 --- a/Makefile +++ b/Makefile @@ -138,6 +138,7 @@ stats : cat include/osgDB/* src/osgDB/*.cpp | wc -l cat include/osgGLUT/* src/osgGLUT/*.cpp | wc -l cat include/osgWX/* src/osgWX/*.cpp | wc -l + cat include/osgText/* src/osgText/*.cpp | wc -l cat include/*/* src/*/*.cpp | wc -l cat src/Demos/*/*.cpp | wc -l cat src/osgPlugins/*/*.cpp src/osgPlugins/*/*.h | wc -l diff --git a/TODO b/TODO index a97ff39a5..eaae87624 100644 --- a/TODO +++ b/TODO @@ -46,6 +46,31 @@ o Core OSG Library . manipulator decoration nodes? . spacial subdivision decoration nodes? + . improved osgUtil:TriStringVisitor to replace NvTriStrip code. + . update of osgText to latest FTGL. + . create osg::Drawable::PrimtiveFunrctor + . support for volume rendering. + . improved stereo support. + . occlusion culling. + . integrated osgEnv. + . implement a osg::CameraRelativeNode for earth sky/HUD's etc. + . thread safety. + . osgMultipipe. + . multi-textureing -> multi-pass support for platforms which do not + support multi-texturing. + . improve tri-intersection code. + . osgParticles - support for particle effects. + . osgAnimation - support for skinning etc. + . osgShader - suppor for shader languages. + . improved makefiles. + . improved impostor implementation - use depth textures? + . clean up multi-bin control. + . improve the node callback mechanism. + . osgUtil::MultiSceneView/Multi-channel configuration. + . support for node kits via the plugins mechanism. + . Added tracking of matrix stacks in osg::State. + . Added ImageGroup's which can be attached to textures for animation. + - Visitors . improve state sorting of opaque bins in osg::RenderBin. . add statistics visitor for logging the stats of the scene graph. @@ -53,11 +78,9 @@ o Core OSG Library - IO/Plug-in support . improve the ascii parsing class osg::Field, osg::FieldReader etc. - . change the osg::Registry to timestamp registrations of objects/RW's. . add support for file path logging into osg::Input. . add binary data reading and writing into osg::Input/osg::Output to support part binary .osg files. - . return error messages of on failed loading/saving. o Reader/writer plug-ins @@ -66,10 +89,8 @@ o Reader/writer plug-ins - .dxf Autocads ascii format. - .dem digital elevation map. - .d3d? MS's Direct 3D file formats if they have one.. - - .bmp Windows Bitmap files. - - .Z Automatic unzipping of Unix Compress files. - - .tar Automatic unpacking of directories and loading of contents. - + - 3D Studio plugin to export to .osg. + - Miya plugin to export to .osg. o Viewers & Application plug-ins =============================== @@ -144,3 +165,6 @@ o Work completed - osg::Plane class. - add osg::Camera class. - add osg::EarthSky class for rendering earth and sky backgrounds. + - return error messages of on failed loading/saving. + - .bmp Windows Bitmap files. + - .tar Automatic unpacking of directories and loading of contents. diff --git a/doc/stereo.html b/doc/stereo.html index 1265f6578..ca16a4ebc 100644 --- a/doc/stereo.html +++ b/doc/stereo.html @@ -13,7 +13,7 @@ The OSG has support for stereo out of the box. Currently both anaglyphic stereo (i.e. red/green or red/cyan glasses) and quad buffered stereo (i.e. active stereo using shutter glasses, or passive stereo using polarised projectors & glasses). It is planned to extend this support horizontal -and virtical spli window based stereo implementations. +and virtical split window stereo implementations.

Almost all OSG applications have the potential for stereo support simply by setting the relevent environmental variables, or via command line arguments. Little or no code changes will be required, the support is handled transparently @@ -24,6 +24,7 @@ in this case refer to the VR toolkits handling of stereo, and do not invoke the OSG's native support, i.e. keep all the OSG's stereo specific environment varibles (below) set to OFF, or set the values to off within own your own applications. +

The environmental variables of interest:

@@ -84,10 +85,9 @@ The environmental variables of interest: set the eye seperation - interoccular distance (default shown.) - +

Command line arguments can be used to override these settings:

-  @@ -129,7 +129,7 @@ Command line arguments can be used to override these settings:
-stereo Switch on QUAD_BUFFER stereo.
- +

Examples:

To invoke stereo from the comandline: diff --git a/src/Demos/Makefile b/src/Demos/Makefile index 47acfa330..f78609693 100644 --- a/src/Demos/Makefile +++ b/src/Demos/Makefile @@ -1,7 +1,10 @@ #!smake SHELL=/bin/sh -DIRS = sgv osgconv osgcube osgreflect osgtexture osgimpostor osgviews osgtext hangglide osgcluster +DIRS = sgv osgconv osgcube osgreflect osgtexture osgimpostor osgviews hangglide osgcluster + +# comment out if you don't have the freetype and GLU1.3 library installed. +DIRS += osgtext all : for f in $(DIRS) ; do cd $$f; $(MAKE) || exit 1; cd ..; done diff --git a/src/Demos/hangglide/base.cpp b/src/Demos/hangglide/base.cpp index c390e2549..e03679bef 100644 --- a/src/Demos/hangglide/base.cpp +++ b/src/Demos/hangglide/base.cpp @@ -66,7 +66,7 @@ Node *makeBase( void ) Texture *tex = new Texture; - tex->setImage(osgDB::readImageFile("water.rgb")); + tex->setImage(osgDB::readImageFile("Images/water.rgb")); tex->setWrap( Texture::WRAP_S, Texture::REPEAT ); tex->setWrap( Texture::WRAP_T, Texture::REPEAT ); diff --git a/src/Demos/hangglide/sky.cpp b/src/Demos/hangglide/sky.cpp index 9770b7a5f..a5aa3473a 100644 --- a/src/Demos/hangglide/sky.cpp +++ b/src/Demos/hangglide/sky.cpp @@ -89,7 +89,7 @@ Node *makeSky( void ) gset->setPrimLengths( lengths ); Texture *tex = new Texture; - tex->setImage(osgDB::readImageFile("white.rgb")); + tex->setImage(osgDB::readImageFile("Images/white.rgb")); StateSet *dstate = new StateSet; diff --git a/src/Demos/hangglide/tank.cpp b/src/Demos/hangglide/tank.cpp index 69900688a..9c0af5276 100644 --- a/src/Demos/hangglide/tank.cpp +++ b/src/Demos/hangglide/tank.cpp @@ -116,7 +116,7 @@ Node *makeTank( void ) tex->setWrap( Texture::WRAP_S, Texture::REPEAT ); tex->setWrap( Texture::WRAP_T, Texture::REPEAT ); - tex->setImage(osgDB::readImageFile("tank.rgb")); + tex->setImage(osgDB::readImageFile("Images/tank.rgb")); StateSet *dstate = new StateSet; dstate->setAttributeAndModes( tex, StateAttribute::ON ); diff --git a/src/Demos/hangglide/terrain.cpp b/src/Demos/hangglide/terrain.cpp index bb761fbd4..ab73aeb6f 100644 --- a/src/Demos/hangglide/terrain.cpp +++ b/src/Demos/hangglide/terrain.cpp @@ -118,7 +118,7 @@ Node *makeTerrain( void ) Texture *tex = new Texture; - tex->setImage(osgDB::readImageFile("lz.rgb")); + tex->setImage(osgDB::readImageFile("Images/lz.rgb")); StateSet *dstate = new StateSet; dstate->setMode( GL_LIGHTING, StateAttribute::OFF ); diff --git a/src/Demos/hangglide/trees.cpp b/src/Demos/hangglide/trees.cpp index b5d87b2f1..89492da15 100644 --- a/src/Demos/hangglide/trees.cpp +++ b/src/Demos/hangglide/trees.cpp @@ -219,7 +219,7 @@ Node *makeTrees( void ) struct _tree *t; Texture *tex = new Texture; - tex->setImage(osgDB::readImageFile("tree0.rgba")); + tex->setImage(osgDB::readImageFile("Images/tree0.rgba")); StateSet *dstate = new StateSet; diff --git a/src/Demos/osgimpostor/osgimpostor.cpp b/src/Demos/osgimpostor/osgimpostor.cpp index be517ad48..d6d42b858 100644 --- a/src/Demos/osgimpostor/osgimpostor.cpp +++ b/src/Demos/osgimpostor/osgimpostor.cpp @@ -79,7 +79,7 @@ int main( int argc, char **argv ) osg::Node* model = osgDB::readNodeFiles(commandLine); if (!model) { - write_usage(osg::notify(osg::NOTICE),argv[0]); +// write_usage(osg::notify(osg::NOTICE),argv[0]); return 1; } diff --git a/src/Demos/osgreflect/osgreflect.cpp b/src/Demos/osgreflect/osgreflect.cpp index cfe034acb..936c7007e 100644 --- a/src/Demos/osgreflect/osgreflect.cpp +++ b/src/Demos/osgreflect/osgreflect.cpp @@ -164,7 +164,7 @@ int main( int argc, char **argv ) if (!loadedModel) { - write_usage(osg::notify(osg::NOTICE),argv[0]); +// write_usage(osg::notify(osg::NOTICE),argv[0]); return 1; } @@ -347,7 +347,7 @@ int main( int argc, char **argv ) osg::Transparency* trans = new osg::Transparency; trans->setFunction(osg::Transparency::ONE,osg::Transparency::ONE); - osg::StateSet* statesetBin5 = createMirrorTexturedState("tank.rgb"); + osg::StateSet* statesetBin5 = createMirrorTexturedState("Images/tank.rgb"); statesetBin5->setRenderBinDetails(5,"RenderBin"); statesetBin5->setMode(GL_CULL_FACE,osg::StateAttribute::OFF); diff --git a/src/Demos/osgtext/main.cpp b/src/Demos/osgtext/main.cpp index 305813866..5a6a6ca4b 100644 --- a/src/Demos/osgtext/main.cpp +++ b/src/Demos/osgtext/main.cpp @@ -45,16 +45,8 @@ using namespace osgGLUT; #define TEXT_COL_3D osg::Vec4(.99,.3,.2,1) -#ifdef WIN32 -std::string ttfPath("./fonts/times.ttf"); -std::string ttfPath1("./fonts/verdana.ttf"); - -#else - -std::string ttfPath("dirtydoz.ttf"); -std::string ttfPath1("fudd.ttf"); - -#endif +std::string ttfPath("fonts/dirtydoz.ttf"); +std::string ttfPath1("fonts/fudd.ttf"); int gFontSize=18; int gFontSize1=24; diff --git a/src/Demos/osgviews/osgviews.cpp b/src/Demos/osgviews/osgviews.cpp index e7b32b2dd..a5219de5e 100644 --- a/src/Demos/osgviews/osgviews.cpp +++ b/src/Demos/osgviews/osgviews.cpp @@ -77,7 +77,7 @@ int main( int argc, char **argv ) osg::Node* rootnode = osgDB::readNodeFiles(commandLine); if (!rootnode) { - write_usage(osg::notify(osg::NOTICE),argv[0]); +// write_usage(osg::notify(osg::NOTICE),argv[0]); return 1; } diff --git a/src/Demos/sgv/sgv.cpp b/src/Demos/sgv/sgv.cpp index 807c6e72d..b37d09501 100644 --- a/src/Demos/sgv/sgv.cpp +++ b/src/Demos/sgv/sgv.cpp @@ -80,7 +80,7 @@ int main( int argc, char **argv ) osg::Node* rootnode = osgDB::readNodeFiles(commandLine); if (!rootnode) { - write_usage(osg::notify(osg::NOTICE),argv[0]); +// write_usage(osg::notify(osg::NOTICE),argv[0]); return 1; } diff --git a/src/Makefile b/src/Makefile index bc7c205df..e89e1ec0a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,8 +1,13 @@ #!smake SHELL=/bin/sh +DIRS = osg osgDB osgUtil osgGLUT -DIRS = osg osgDB osgUtil osgText osgGLUT Demos osgPlugins +# comment out if you don't have the freetype and GLU1.3 library installed. +DIRS += osgText + +DIRS += Demos +DIRS += osgPlugins all : for f in $(DIRS) ; do cd $$f; $(MAKE) || exit 1; cd ..; done diff --git a/src/osg/Light.cpp b/src/osg/Light.cpp index bd88aa509..b8293e318 100644 --- a/src/osg/Light.cpp +++ b/src/osg/Light.cpp @@ -12,16 +12,16 @@ Light::Light( void ) init(); - // notify(DEBUG) << "_ambient "<<_ambient<(getOsgObject(sequence)); if (osgSequence) @@ -724,38 +724,38 @@ osg::StateSet* ConvertFromPerformer::visitGeoState(osg::GeoSet* osgGeoSet,pfGeoS // Don could you fill in some of these blanks??? unsigned int inherit = geostate->getInherit(); - // osg::notify(DEBUG) << endl << "Inherit = "<setMode(GL_BLEND,osg::StateAttribute::INHERIT); else @@ -921,8 +921,8 @@ osg::StateSet* ConvertFromPerformer::visitGeoState(osg::GeoSet* osgGeoSet,pfGeoS osgStateSet->setAttribute(osgTexGen); break; case(PFTG_EYE_LINEAR_IDENT) : - cerr << "TexGen Mode PFTG_EYE_LINEAR_IDENT not currently supported by the OSG,"<setMode(osg::TexGen::EYE_LINEAR); osgStateSet->setAttribute(osgTexGen); @@ -935,15 +935,15 @@ osg::StateSet* ConvertFromPerformer::visitGeoState(osg::GeoSet* osgGeoSet,pfGeoS osgTexGen->setStateSetModes(*osgStateSet,osg::StateAttribute::OFF); break; case(PFTG_OBJECT_DISTANCE_TO_LINE) : - cerr << "TexGen Mode PFTG_OBJECT_DISTANCE_TO_LINE not currently supported by the OSG."<setStateSetModes(*osgStateSet,osg::StateAttribute::OFF); break; case(PFTG_EYE_DISTANCE_TO_LINE) : - cerr << "TexGen Mode PFTG_EYE_DISTANCE_TO_LINE not currently supported by the OSG."<setStateSetModes(*osgStateSet,osg::StateAttribute::OFF); break; default: - cerr << "TexGen Mode "<setStateSetModes(*osgStateSet,osg::StateAttribute::OFF); break; } diff --git a/src/osgPlugins/pfb/ConvertToPerformer.cpp b/src/osgPlugins/pfb/ConvertToPerformer.cpp index 61cdd57f2..b47d4274c 100644 --- a/src/osgPlugins/pfb/ConvertToPerformer.cpp +++ b/src/osgPlugins/pfb/ConvertToPerformer.cpp @@ -95,7 +95,7 @@ pfObject* ConvertToPerformer::getPfObject(osg::Object* osgObj) OsgObjectToPfObjectMap::iterator fitr = _osgToPfMap.find(osgObj); if (fitr != _osgToPfMap.end()) { - osg::notify(osg::DEBUG_INFO) << "Found shared object"<getCoordIndices(); if (cindex.valid() && !cindex._is_ushort) { - osg::notify(osg::WARN)<<"Warning: Cannot convert osg::GeoSet to pfGeoSet due to uint coord index."<getNormalIndices(); if (nindex.valid() && !nindex._is_ushort) { - osg::notify(osg::WARN)<<"Warning: Cannot convert osg::GeoSet to pfGeoSet due to uint normal index."<getColorIndices(); if (colindex.valid() && !colindex._is_ushort) { - osg::notify(osg::WARN)<<"Warning: Cannot convert osg::GeoSet to pfGeoSet due to uint color index."<getBound(); _camera->setLookAt( - boundingSphere._center+osg::Vec3( 0.0,-2.0f * boundingSphere._radius,0.0f), + boundingSphere._center+osg::Vec3( 0.0,-3.0f * boundingSphere._radius,0.0f), boundingSphere._center, osg::Vec3(0.0f,0.0f,1.0f)); diff --git a/src/osgUtil/RenderBin.cpp b/src/osgUtil/RenderBin.cpp index 1b7daaa22..6ae5918d1 100644 --- a/src/osgUtil/RenderBin.cpp +++ b/src/osgUtil/RenderBin.cpp @@ -20,7 +20,7 @@ RenderBinPrototypeList* renderBinPrototypeList() RenderBin* RenderBin::createRenderBin(const std::string& binName) { -// cout << "creating RB "<find(binName); if (itr != renderBinPrototypeList()->end()) return dynamic_cast(itr->second->clone()); @@ -32,7 +32,7 @@ void RenderBin::addRenderBinPrototype(RenderBin* proto) if (proto) { (*renderBinPrototypeList())[proto->className()] = proto; -// cout << "Adding RB "<className()<className()<getBound(); - _camera->setView(boundingSphere._center+osg::Vec3( 0.0,-2.0f * boundingSphere._radius,0.0f), + _camera->setView(boundingSphere._center+osg::Vec3( 0.0,-3.0f * boundingSphere._radius,0.0f), boundingSphere._center, osg::Vec3(0.0f,0.0f,1.0f)); @@ -285,7 +285,7 @@ bool TrackballManipulator::calcMovement() else { - // notify(DEBUG_INFO) << "Pushing forward"<getLookVector()*(dy*scale);