[Plib-users] Need advices to use Plib for a Roam algo
Brought to you by:
sjbaker
From: Maltez <ma...@no...> - 2001-07-25 23:20:46
|
HI I have implemented a terrain engine with a ROAM like algo. It's all = coded from scratch using Opengl with Glut and without a scene graph = hierarchy of classes. I am evaluating to use a scene graph toolkit to port my engine and the = add other functionality like sky, tree,... with Plib. Plib seems to be very lightweight but powerfull and let a clear access = to OpenGl. Such small and clever thin toolkit i like. I'm new to Plib and i would like to have some advices to make the right = (or not too wrong) use of Plib classes and right use of sub-classing = shema. My current architecture is as usual : a manager class containing a grid = of 10x10 tiles each containing 2 bintrees. The manager class refine the = mesh with splits/merges when the camera frustrum change in a method = Update(). The Render() method feeds arrays of = vertices/normal/texcoord/colors for each tile and then draw them with a = glDrawElements() call. Now the dumb questions : - Is it correct to subclass the ssgBranch class to implement my tile = manager class and subclass the ssgVtxArray for my tiles class ? - another approach seems to use the predraw callback on a ssgBranch = containing ssgVtxArray and doing all the work in my manager and tile = classes (which will not be subclasses of ssgBranch and ssgVtxTable) ? in = that case how to get the frustrum i need to the cull the triangles ? - i plan to share one instance of ssgVertexArray, ssgNormalArray,... for = all the ssgVtxArray tiles and a refresh the vertices before each draw of = each tile. Is there some pitfall with that ? - how to skip the culled out tile in the cull (and draw) traversal ? - another approach is put all in a fresh new subclass of ssgLeaf (and no = use of ssgVtxArray or ssgBranch). What about this technic ?=20 I would be glad to have some advices, critics or ideas to use Plib for = my Roam engine. Thanks |