To build up a multi-projector display system

I want to build up a multi-projector display system.
Server can create rtsp stream for client player.
Config can save each screan by real projector position.
Client Player can load video, split images, handle edge blendering for each projector.
I am newcomer for CGE. and wonder whether CGE can do it well.
or is there any example for this ?


Sorry for the lack of response for such a long time. I was buried in lots of CGE tasks, and admittedly your question wasn’t trivial, so I see you didn’t get an answer. Let me try :slight_smile: Here’s a teaser screenshot:

I would split the description of your application into:

  1. You want to read stream of images from the Internet.

    This part is mostly outside of CGE – though you can use our TCastleDownload ( Castle Game Engine: CastleDownload: Class TCastleDownload ) to perform HTTP(s) requests. But you can also use any other networking library that fits you.

  2. You want to define a 3D world with projectors, and some things where projectors cast their image (e.g. walls of a room, and inside this room are projectors).

    I would recommend you just set up your 3D world in the Castle Game Engine editor, and not worry about allowing user to configure the projectors, at first. Follow our manual ( Manual | Manual | Castle Game Engine ), in particular take a look at the viewport features, Viewport with scenes, camera, navigation | Manual | Castle Game Engine , to learn how to set up 3D models.

  3. You want to actually make “projector” perform its work, i.e. “cast a texture” on other 3D objects.

    More on this below – this is the interesting, non-trivial bit, but yes, you can do this with CGE.

  4. You want user to configure projectors translation/rotation.

    You can store the projectors translation/rotation in a user config using UserConfig (see Persistent data (user preferences, savegames) | Manual | Castle Game Engine ). When loading, set the projector translation (TVector3) and direction (TVector4).

AD 3 How to “cast a texture” from a projector?

The answer is to use the TProjectedTextureCoordinateNode in Castle Game Engine, that allows to cast a texture along the direction of some (maybe “fake”, i.e. used only to cast texture) light or viewpoint.

I started writing here a detailed explanation… but eventually I decided to just turn it into a complete Castle Game Engine example :slight_smile: The new example is now committed to the Castle Game Engine repository, in examples/viewport_and_scenes/projector.

It really only does one thing from code: modifies the loaded scene in SceneLevel1 to add there a TProjectedTextureCoordinateNode. The main code is in example’s code/gameviewmain.pas unit.

Please take a look at this example, and the accompanying inside, I tried to explain there everything. If you’re interested in going forward, just ask – I can explain how to extend this.

To download the new engine along with this example,

Here are screenshots how it looks in editor and when working: