Re: [Plib-users] Plib as a Model Loader
Brought to you by:
sjbaker
From: Steve B. <sjb...@ai...> - 2004-07-09 00:35:15
|
Tyler Ohlsen wrote: > I'm looking at using plib as a model loader for a flight simulator type > application I'm making, but that's all I want plib for. (I don't want > to use plib as my scene graph library) The problem with 3D file loaders is that they have to load the model into some kind of data structure. The name for that data structure is a "Scene Graph". Hence, loaders for 3D file formats cannot exist wihout a scene graph. Since rendering stuff out of that scene graph is an easily automatable process - and since it makes a lot of sense to use a C++ class hierarchy to do the work, it follows that the renderer and the file loader are tightly knitted together. Tossing out the renderer in order to get the loaders is not generally a good idea. > I've played around with the simple scene graph module and I see that > calling ssgCullAndDraw throws out the existing projection and modelview > matrices forcing you to use ssg's camera. I would like to use my own > camera and not have to use ssg's camera at all. SSG lets you set both the modelview and projection matrix directly. It's hard to imagine what "your own camera" could be that SSG couldn't already handle. > Is there a way to call a draw method of an ssgRoot object that does not > throw out the these matrices and leaves the view culling up to the > application (it just draws around the current zero point like > glutSolidTeapot and such)? No - because SSG needs to know that those matrices are in order to do field-of-view culling, Range-switched nodes and such. OK - we *could* read those matrices back from OpenGL in order to find out what your camera code set them to - but reading things back from OpenGL is something to be avoided at all costs. So it's better for you tell use what you want them to be and let us send them to OpenGL...that's no different from you sending them to OpenGL - but this is more efficient. > If there doesn't exist such a method, would > there be an interest for me to create one for you all? I don't see any conceivable need for that - but if you can come up with something convincing, we could certainly consider it. ---------------------------- Steve Baker ------------------------- HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://www.sjbaker.org Projects : http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net http://prettypoly.sf.net -----BEGIN GEEK CODE BLOCK----- GCS d-- s:+ a+ C++++$ UL+++$ P--- L++++$ E--- W+++ N o+ K? w--- !O M- V-- PS++ PE- Y-- PGP-- t+ 5 X R+++ tv b++ DI++ D G+ e++ h--(-) r+++ y++++ -----END GEEK CODE BLOCK----- |