Thanks for the info Skylark. I got it working today and made a blog post about 
the process in extremely simplified terms:
http://dwightdesign.com/2009/05/installing-openscenegraph-280/

I've added a link to this tutorial on the tutorial originally giving me 
problems, so hopefully it will help others in the future.

I actually do know about computer graphics and programming. I'm mainly using 
OSG so that I can avoid building my own OO wrapper for OpenGL (again, mine 
wasn't very robust) and have built-in model loading to speed up my development 
time. I've done a fair amount of graphics work in an academic setting, but I've 
never worked with a large open source project designed for Unix systems. That's 
why I understood some of what was going on, but not all of it.

I imagine most of my questions from now on will be related to how to use OSG 
libraries in terms of what functions to use to get the desired result.

Thanks for your help everyone!


Skylark wrote:
> Helo Dwight,
> 
> 
> > However, as I suspected, one can develop using the precompiled binaries. My 
> > only problem is that I don't know how to do that. At least not with a 
> > project this large. One library maybe, but OSG is huge. 
> > 
> 
> Well, there are two parts to your question: how do I use OSG (i.e. what 
> settings do I have to use in my project to be able to compile something 
> using OSG) and how do I use OSG (i.e. how do I learn the API and use it 
> to make something).
> 
> -------------------------
> The first part is actually the same as for any other library.
> 
> 1. Set the include paths to point to the OSG include directory.
> 2. Set the library path to point to the OSG lib directory.
> 3. Add the necessary libraries to the linker settings.
> 4. Make sure your path contains the necessary directories so that 
> dynamic libraries are found at run time.
> 
> That's also the same thing you'd do on Linux or Mac OS X. C++ 
> development is more or less the same on any platform, it's just the 
> tools that change.
> 
> For 1, you'll find that in the project settings under C/C++ - General - 
> Additional Include Directories.
> 
> For 2, you'll find that in the project settings under Linker - General - 
> Additional Library Directories.
> 
> For 3, you'll find that in the project settings under Linker - Input - 
> Additional Dependencies. Now, the hard part is figuring out what 
> libraries you need. The basic set would likely be osg.lib, osgUtil.lib, 
> osgDB.lib, osgViewer.lib, osgGA.lib, osgText.lib (add a 'd' to each in 
> your Debug project's settings). After that, if you get any linker 
> errors, examine the error and you'll figure out which library you need 
> to add (for example, if it says it has an unresolved symbol 
> "osgAnimation::Something::doSomething()", you need osgAnimation.lib).
> 
> For 4, you have a few options. You can add your OSG install's bin 
> directory to your system PATH variable. Or in your project settings 
> under Debugging - Environment, you can put "PATH=$(OSG_BIN_PATH)" (and 
> make sure Merge Environment is set to Yes) and that will add the OSG bin 
> path to your PATH when you run your app under the Visual Studio debugger 
> (but leave the system PATH untouched, which is useful in case some other 
> app needs another version of OSG for example). Or you can put the OSG 
> DLLs directly in the same directory as your application's executable 
> (search the archives if you want to do this, there are a few gotchas for 
> this method to work well).
> 
> Number 4 under Linux is a separate environment variable called 
> LD_LIBRARY_PATH, but on Windows it's all just the PATH. It's used for 
> both executables and dynamic libraries.
> 
> I generally set up the settings for both the debug and release 
> configurations right at the start so that I know I can readily switch 
> from one to the other without problems. The only things that change 
> between the two - apart from default settings that VS sets differently - 
> are the 'd' suffix to library names and _DEBUG instead of NDEBUG in the 
> debug configuration.
> 
> I also normally start with a copy of 
> <OSG_sources>/applications/osgviewer/osgviewer.cpp , and if that 
> compiles and runs in both debug and release, I know I've got the include 
> and linker settings right. From there I modify the code and add new 
> files as I see fit for my project.
> 
> If you need any more in-depth info about what libraries are, what such 
> and such a setting does, etc, just Google it and you'll find out. A big 
> part of learning your tools is experimenting and finding out things by 
> doing.
> 
> -------------------------
> The second part, how do I learn to use the OSG API, is a very common 
> question here. I'll give you some useful links while I discuss this...
> 
> First, you can search the archives (I like to use 
> http://dir.gmane.org/gmane.comp.graphics.openscenegraph.user but there 
> are other sources) to see what was suggested in other discussions. 
> Search for "documentation" or "learning" and you'll probably  get 
> interesting results.
> 
> Second, there's the OSG Quick Start Guide which you can download as a 
> PDF for free (or buy a nice quality book for a good price) at 
> http://www.osgbooks.com/ .
> 
> The best source of info for how to use a given feature of OSG is the 
> examples. There are a large number of them, so it's a good thing you 
> downloaded the OSG source (even if you end up using the precompiled 
> binaries for your project) because then you can search for a given class 
> name or keyword in the sources and find many examples that show how to 
> use that class or do a given thing.
> 
> Also, you can browse the OSG wiki to find some examples, some 
> documentation and some general info, but just as the how-to you tried 
> initially was slightly outdated, some pages on the wiki might be 
> outdated at various levels too (though most of it is accurate). Please 
> let us know if anything is unclear or seems to be out of sync with 
> current versions of OSG.
> 
> Of course, to use all that you'll need to have an idea of what you want 
> to do, and at least some knowledge of computer graphics. For this I can 
> recommend books (all of this has been said before and you'll find more 
> recommendations in the archives but these are my choices):
> 
> - Computer Graphics: Principles and Practice by Foley, Van Dam et al. (a 
> classic, very general but very useful as a primer)
> - Real-time Rendering by Möller and Haines (more up to date and still 
> very general, and a launch pad to other publications through its 
> extensive references)
> - OpenGL Distilled by Paul Martz (more OpenGL centric, which is very 
> useful for using OSG since it's a thin layer over OpenGL)
> - OpenGL red book and orange book (again, more OpenGL centric, and the 
> orange is about shaders which you might or might not need depending on 
> what you want to do)
> 
> In particular, if you want to refer to something for academic work, the 
> Real-time Rendering book is a great source because whenever the authors 
> talk about some technique, they'll cite the original paper that 
> introduced it and will go over any follow-up techniques that refined the 
> original technique. It's very useful information and very interesting too.
> 
> There is also some info on various web sites (the FAQs on opengl.org are 
> good, and you can find some tutorials and stuff on other sites) but some 
> of it has to be taken with a grain of salt. The real references to 
> OpenGL are listed above, and you'll likely come across some web 
> tutorials written by inexperienced people feeling their way through 
> something and explaining as though they'd figured it all out... But that 
> can be said about anything on the web.
> 
> I hope this helps, and don't hesitate to ask if you have more questions 
> (but please quote parts of the message you're replying to, it helps to 
> know what the context of your reply is).
> 
> J-S
> -- 
> ______________________________________________________
> Jean-Sebastien Guay    
> http://www.cm-labs.com/
> http://whitestar02.webhop.org/
> _______________________________________________
> osg-users mailing list
> 
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 
>  ------------------
> Post generated by Mail2Forum


------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=12054#12054





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to