Starfield simulation

In this section, we will be looking into building efficient 3D visualizations that use multiple geometries. We will create a starfield simulation using TSphere and TObjectProxy components for sharing mesh data.

If we look into the source code of TSphere, TCone, TCylinder and other components in the FMX.Objects3D unit, we will see that their vertices and indices are hardcoded. If we want to build a 3D scene with many different objects, every object will occupy quite a lot of space in memory.

FireMonkey comes with a special TProxyObject 3D object. It does not hold its geometry, but instead has the SourceObject property that can be used to connect to any other 3D object which is used for rendering. In this way, we have just ...

Get Expert Delphi now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.