- Add a user data variable to the LOD that identifies the last LOD child
that the attach was done for.
- Add a cullcallback to all LOD children that checks if the parent LOD's
user data variable is different than the current child. If it's different
then you need to reattach, then reset the parent LOD user data variable to
the current child.

You may not want to perform the attach in the cull. It might be better to
wait until the next update.

I haven't actually tried this and it won't work for LODs with multiple
children that are active (not culled) for a given range.

Brian

[EMAIL PROTECTED] wrote: -----


To: "OpenSceneGraph Users" <[email protected]>
From: Brian <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]
Date: 02/01/2008 03:29PM
Subject: Re: [osg-users] PagedLOD: Notification or callback when an LOD is
changed.

Hi Brad,

I would recommend you read through the PagedLOD.cpp file especially the
"traverse()" function.
There isn't a callback for when the LOD changes happen.  You could create
an UpdateCallback()
that would calculate the current LOD, but it sounds awful complex and error
prone.  osgdem generatates a
series of nested LODs so you would have to figure out which LODs are
relevent, plus deal with the loading of PagedLODs.

Could you instead create LODs for your buildings with a matrix transform
and adjust the position of the building slightly for different distances
from the camera that match when the terrain LOD changes?

You could load your terrain in osgSceneMaker and create LODs  for your
building adjusting them up and down for difference distances away from the
camera that match with when the terrain LOD changes then save the LODs to
an .ive file.

Another thing you could try is to use the --no-terrain-simplification
setting in osgdem or look in the source code for osgdem and increase the
desired triangles during simplification (Can't rememember the exact line
but search for 512 in the code.)   This will lower your FPS and increase
your file size, but it would reduce the terrain shifting.

Brian
http://osgscenemaker.googlepages.com


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

This is a PRIVATE message. If you are not the intended recipient, please
delete without copying and kindly advise us by e-mail of the mistake in
delivery. NOTE: Regardless of content, this e-mail shall not operate to
bind CSC to any order or other contract unless pursuant to explicit written
agreement or government initiative expressly permitting the use of e-mail
for such purpose.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

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

Reply via email to