TCastleControl with several TCastleViewports displaying one TCastleScene

Tell me, or better yet, give an example of an application that uses TCastleControl with several TCastleViewports displaying one TCastleScene from different angles.

Hi! See this example:

They use TCastleWindow, not TCastleControl, but the appoach is the same. You can just put multiple TCastleViewport instances inside TCastleControl (you can create them using Pascal code, or load a design made in CGE editor, following Engine on a form (VCL, FMX, LCL) using TCastleControl | Manual | Castle Game Engine ).

Thanks for the reply. Yes, of course I watched these examples. Including here Multiple viewports to display one world | Manual | Castle Game Engine . But when using Viewport 1.Items:=Viewport2.Items; the program falls into an exception.
For this, I ask for an example to figure it out

I hope the example on cge-www/htdocs/code-samples/two_viewports.lpr at master · castle-engine/cge-www · GitHub is sufficient then :slight_smile: It works OK, no exception. You can use the same approach with TCastleControl, you can also design the same components in CGE editor.

If this doesn’t help you solve the problem, please provide more details – first of all the exact exception message, and the code causing it (preferably a complete testcase that we can test and compile), and specify with what compiler (FPC, Delphi, what version) and on which system you test it.

That’s what you need. Thank you, I will study it