[Plib-users] RE: How should I use plib?
Brought to you by:
sjbaker
From: Troy Y. <tro...@ho...> - 2000-08-17 06:00:19
|
FROM: Steve Baker DATE: 08/15/2000 22:28:39 SUBJECT: RE: [Plib-users] How should I use plib? Thanks for your response Steve. I don't know how you managed to fit all you do into a day but I'm certainly glad you do. I really appreciate your input. Steve Baker wrote: > Troy Yee wrote: >> >> Q: What is the best way to create a scene/world using plib? >> It seems to me that loaders are extremely useful but >> what is their impact on one`s ability to render a scene >> quickly and efficiently? Aside from loading a model, >> and scaling/rotating/translating it what else must be >> done to manage the scene/world (i.e. BSP trees, LOD, etc.)? > > Theoretically - you don`t need to do ANYTHING - that`s what > SSG is good at. > > SSG uses whatever the hierarchy of the scene is in the > model file - and does heirarchical field-of-view checking to > ensure nothing outside the field of view gets rendered. > In TuxKart and TuxAQFH, I`ve used comment fields with a magic > first character to tell the loader to generate certain kinds > of ssgBranch node that the loader wouldn`t otherwise be able > to generate. That`s one way to get LOD nodes into your > scene. > > However, the idea is that you dump the scene into SSG and let > it worry about all the rendering issues. > So one way to use plib is to develop maps/scenes/tiles using some package that exports to a format for which plib has a loader (or write a new loader which reproduces the hierarchy of the scene). Would one expect this to be the most common method of getting a scene into one's application? How does one add dynamic objects to the scene? Just add a transform node to the root? Try to find out where in the scene hierarchy it should be placed? Probably the former - what is the impact on rendering? >> One of the immediate problems with my ocean approach is that >> the ocean often disappears - it depends on the direction the >> camera is pointing and where in the scene it is placed. I`m >> guessing that it`s getting culled because there are no vertices >> of the ocean inside the view frustum. > > No - that`s not possible. SSG computes a bounding sphere around > all the vertices in each leaf node - if any part of the sphere > lies inside the view frustum, the node will be passed on to OpenGL. > > Are you creating the ocean model in code - or loading it via > one of the SSG loaders? Hmm... I'm using ssgLoadAC(), not creating it myself. After I load the model, I add it to a transform node, rotate it (I hand built the model in z-is-up format so I have to undo the rotate that the loader does), then scale it from unit size to the game board size. I don't make any other changes after that. Do I have to force a recalculation of the BSphere in this case? (I thought cullAndDraw would do a recalc if it was needed). >> Here`s the worst part (I think) of how I`m realizing this land >> in the scene... <cringing in anticipation of being bashed about >> the head>... I`m loading a single instance of a unit sized AC3D >> cube, scaling the height to match the height of a grid point >> (by adding model to ssgTransform node) and translating it to >> the appropriate grid location. The net result is lots of >> stretched cubes clustered about. > > You certainly need some serious help! :) > You should use a triangular mesh I think. Yes, I knew that but I wanted to generate something I could look at with a minimum of effort. Load - scale - move was much easier than trying to generate a mesh on the fly. >> How does one deal with being able to warp the >> camera anywhere on the map though? > > Well, it`s *VERY* complex. <snip> My choice of the word 'warp' was not the best. It sounds like you took it to mean something like 'fly really really really fast'. I was actually thinking in the X-windows sense of warping a pointer - an instantaneous move to a new location. The idea here is that a user selects a new entity from which to look at the scene. This isn't *VERY* complex is it? I suspect the issue is that the new location could be quite far away from the current location so the tiles likely wouldn't be loaded. I don't imagine that the new tiles can be loaded quickly enough to satisfy most users or can they? I'll look at TerraGear. I suspect I'll be able to get away with a lot less detail - the simulation will survive with no 3D at all (but won't be nearly as interesting!). Thanks again for taking the time to respond, Troy. |