1

I have a routine which adds a few hundred (mainly TGLextrusionsolid) objects into the scene.

The routine loads all the objects into GLscene with no problems in a few milliseconds but after exiting the loading code and allowing entry back into the main processing loop the program hangs for several seconds.

I presume this is caused by GLscene building the scene in its internal routines.

Once the scene appears on the screen after a few seconds, everything is fine, it can be rotated and zoomed at full speed.

Is this long delay between loading the objects and the scene apearing on screen normal?

Is there any way to stop it hanging the main thread whilst its doing its stuff?

Andy k
  • 1,056
  • 1
  • 11
  • 22
  • Extrusion solids are somewhat complicated to calculate (see _TGLExtrusionSolid.BuildList_) and that obviously needs time. If those solids are static in their shape, you can calculate the meshes beforehand and add those to the scene. Unfortunately there is no direct way to create these meshes. You might try a suitable 3D designer application for that. – Uwe Raabe Feb 16 '17 at 11:36
  • @Uwe No they are not static, they are 2D planar polygons extruded into the third dimension. The polygons also have an outer loop and maybe several inner loops representing holes in the polygons. A typical object would be a printed circuit board with the polygons repesenting the copper land patterns and the inner loops representing the via holes. – Andy k Feb 16 '17 at 11:44
  • So then you might have to live with the time needed to build the graphics. – Uwe Raabe Feb 16 '17 at 13:52
  • It would be nice if we could hook into the render progress and and give the user the chance to cancel in case he accidently sent a million polygons to be rendered. The GLscene.onprogress event doesn't seem to do anything. – Andy k Feb 16 '17 at 15:05
  • Go ahead. After all it is open source. The OnProgress event is only used when you have a cadencer changing the scene over time. – Uwe Raabe Feb 16 '17 at 16:29
  • Do you know if its possible to create duplicates, without recreating each object? The objects I am rendering are sometimes composed of many step and repeat duplicates. It would save time if these could be meshed just once and copied. – Andy k Feb 16 '17 at 21:52
  • 3
    Looks like a job for TGLProxyObject. – Uwe Raabe Feb 16 '17 at 22:11
  • Looking that up now, looks promising. Thanks for your help ! – Andy k Feb 16 '17 at 22:36

0 Answers0