Render fewer shapes while zoom or rotate for a large model

I want to use OCCT to develop a CAD for architecture, the buidling is large, so there are lots of shapes. As other architecture modeling software, when there model is large, it will hide some shapes of the building while zoom or rotate. I also want to do this with OCCT, but not find the way yet.
For example, there are 100,000 shapes, while zoom or roate, only 1,000 shapes will display. After zoom or rotate is done, the rest shapes will display. What should I do? Is there an interface I can override to achieve it?

Thanks,
Andy

Ivan P's picture

Well, when you rotate scene and camera is not directed on those thousands of shapes - they won't be rendered and processed. It is done by low-level implementation of graphic engine, out-of-the-box, so you do not have to worry about it.

When you scale on scene and wish to see fewer or more objects depending on your scale, or drop details of shape if you are far from it - this feature is called `level of detail`. It should be in Visualization component, but I have not found mentions about it in reference. Maybe you may get some inspiration: https://dev.opencascade.org/doc/overview/html/occt_user_guides__visualiz...

gkv311 n's picture

What does OCCT provides out of the box:

  • Frustum culling. Skips rendering of objects, which AABB has no overlapping with camera view point. Enabled by default.
  • Size culling. Skips rendering of objects, which AABB projected onto screen is below specified limit. Defined by Graphic3d_ZLayerSettings::CullingSize() and disabled by default.
  • Distance culling. Skips rendering of objects, which distance from camera Eye point is larger than specified limit. Applicable only to perspective view. Managed by Graphic3d_ZLayerSettings::CullingDistance and disabled by default.

Mechanisms maintaining different levels of detail (LODs) for the same object (like tessellation density) or for a group of objects are not available in API and should be implemented at application level, when needed.