Search code examples
qtqgraphicsviewqgraphicsscene

Qt Graphics: How to make 2D animation look like 3D?


I am trying build a 2D QGraphicsScene and there is several 2D picture items in the scene, then create an animation like zoom in, the camera move onto an item. During the animation, These items shall be perspective view just like 3D.

How to make 2D object look like having the 3D coordinate.


Solution

  • Changing the sign should work for the rotation. You can get an effect of depth by correct drawing order and size. smaller objects must be behind larger ones and in case of any scrolling should scroll slower (google for paralaxis effect and parallax scrolling) 30 years old video games used also that technology.

    All this, the layering, the size and the sensible movement speed simulate the existence of a depth coordinate.

    If you make the "distant" objects darker the depth effect will be even stronger.

    And you need continuous movement to get the proper effect. As long as the scene moves it will have the depth effect. A static scene will always be flat.