gwaldron / osgearth

3D Maps for OpenSceneGraph / C++14
https://www.pelicanmapping.com/home-1/opensource
Other
1.47k stars 772 forks source link

[HELP] Update vertexarray through nodevisitor, then can't see mode in some view, and pagelod doesn't work #2548

Closed YHLpuyu closed 2 months ago

YHLpuyu commented 3 months ago

I have some osgb that has pagelod, which is oblique model. The osgb model is in a plane, I want add it into osgearth on ground. So I must project the vertexes of geometry from plane to sphere, after model loaded. I project the coords of geometry into world coordinates, and I can see the root model. But maybe the boundingsphere doesn't update, the child of model doesn't load, and the model dispares in some view. image image

any suggestions, if i change the verties of model, and i can still use pagelod for lods, or there is another method.

gwaldron commented 3 months ago

Hello. Yes, it sounds like you have culling problems, and you need to update the bounding spheres in your model as well. If you change the vertex values, you will need to call dirtyBound() on the geometry node so that OSG can recompute the bounding spheres.

For PagedLOD nodes you might also need to reproject the center point of the LOD (set/getCenter) and call dirtyBound() on that as well, depending on how the scene graph is set up. Good luck!