# Seamless transition between 2D and 3D (Aero Flip)

This topic is 3246 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I am using a orthogonal projection matrix to set up drawing 2d quads in screen space. Now I want these quads to "tilt" away in a 3-dimensional fashion, and I am struggling with getting a smooth and spotless transition from 2D to 3D. Initially I tried to set up a 3D projection-matrix with a suitable camera position and switch between that and the 2D orthogonal projection as soon as I want my 2D quad to "tilt away". But that is never precise, and I need to work with weird camera offset positions that I am sure only work with the current screen resolution. So there must be a better approach. I started working with transformed vertices, and doing the transformation and projection myself, but don't achieve satisfying results with that yet either. The Desktop Window Manager (starting with Vista) does that all the time: all the windows are properly displayed without any "texture blurring", and it seamlessly transitions between 2D and 3D effects (a perfect exampled is Aero Flip). How do they do that? [Edited by - ori-on on December 2, 2009 5:59:01 PM]

##### Share on other sites
In the meantime I found a clean solution:

float fov = Math::PI/4;
float aspect = 1.0f;
float nearClip = 1.0f;
float farClip = 100.0f;

Matrix p;
p.buildProjection(fov, aspect, nearClip, farClip);

// NOTE: at this point we should multiply the projection matrix with a camera look at matrix
// but offsetting the projection matrix with that distance is simpler

float distance = 1.0f / tan(fov*0.5f);

p._43 += distance;
p._44 += distance;

1. 1
Rutin
45
2. 2
3. 3
4. 4
5. 5
JoeJ
19

• 13
• 10
• 12
• 10
• 13
• ### Forum Statistics

• Total Topics
632999
• Total Posts
3009812
• ### Who's Online (See full list)

There are no registered users currently online

×