• Advertisement
Sign in to follow this  

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

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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;

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement