Minimal proposal

  • Switch ClutterStage to an orthographic projection matrix.

  • Allow users to set up a perspective projection on a per-actor basis.


Clutter has always used a perspective projection by default on the Stage; a perspective projection has the advantage of easily show the 3D transformations available with Clutter, but it does complicate the life and expectation of users that wish to have a pure 2D UI, with a specific 3D viewport only when needed, or no 3D viewport at all.

Going from a perspective projection to an orthographic one on a per-actor basis is also complicated by the need to unroll part of the matrix stack to avoid nodes in the scene graph to go out of sight.

Clipping is also complicated by the fact that we have to take into consideration a complex transformation scenario, even if most of our user base won't end up into it.

By switching to an orthographic projection as the default for ClutterStage we would have a default behaviour that kept scaling, as well as rotation along the Z axis, which are the two most common transformations used by Clutter developers; perspective transformation could be provided as a simple opt-in for actors to apply to their children, simply by changing the ClutterActor:child-transform matrix to have a perspective component, for instance:


  float zDistance = 850.f; = 1.0f / -zDistance;
  clutter_actor_set_child_transform (container, &aMatrix);


  • ClutterStage should set up an orthographic projection on the viewport.

  • Setting the ClutterActor:transform property provides an initial transformation, instead of a full replacement of the transformation.

    • This allows setting up a perspective transformation on an actor without clobbering the decomposed transformation API.


  • No new API is necessary for this feature


Attic/Clutter/Strawman/Projection (last edited 2024-04-11 15:39:36 by EmmanueleBassi)