1

Is there a way to change the clutter perspective for a given container or widget?

The clutter perspective controls how all the clutter actors on the screen are displayed when rotated, translated, scaled, etc.

  1. What I would really like to do is to change the perspective's origin from the center of the screen to another coordinate.

I have messed with a few of the stage methods. However, I haven't had much luck understanding some of the results, and often I hit some stability issues.

I know there are transformation matrices that do all the logic under the hood, and there are documented ways to change the transform matrices. Honestly, I haven't researched much further and just though I would ask for guidance before spending a lot of time on it.

  1. Which leads me to another question regarding the matrices and transformations. Can one of these matrices be used to skew an actor? Or deform it into a trapezoid, etc? And any idea how to get started on that, ie. what a skew matrix would look like?

  2. Finally, does anyone know why the clip path was deprecated? It seems that would have worked for what I ultimately want to do: draw irregular shaped 2d objects on the screen If I can implement an answer to question 2, then I guess a clip box with a transformation can be used here.

mknap
  • 11
  • 4

1 Answers1

0

1, I do not know if (or how) one might change the Clutter stage's focal point.

2 A skew or shear transformation matrix is easy enough to construct, and can be implemented in the GJS Clutter functions Clutter.Actor.set_transform(T) and Clutter.Actor.set_child_transform(T) where T is a Clutter.Matrix .

This does present another problem, however, for the current codebase; and this leads to another question. (I guess I should post it somewhere else). But, when a transform is set on a clutter actor (or its children), the rest of the actor's properties are ignored. This has the added effect that the Tweener library cannot be used for animation of these properties.

3 Finally, one can use Cairo to draw irregular shaped objects and paths on a Clutter actor, however, the reactive area for the actor (ie. mouse-enter and -leave events) will still be for the entire actor, not defined by the Cairo path.

mknap
  • 11
  • 4