Custom Wireframe component

The source code of FireMonkey is very helpful in understanding how the library works, but we can also use it as a template to build our own custom components. Rendering a cube is not a lot of code but using a similar approach, we could create a custom wireframe component that is similar to TStrokeCube. We can just implement the Render method differently and paint arbitrary lines, the coordinates of which are stored internally within our component.

Create a new Delphi multi-device application and select 3D Application as the application type. Save the main form unit as uFormWireframe and the whole project as WireframeTest. Rename the form as FormWireframe. Save all.

Add a new unit to the project and save it as

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.