Jump to content
  • Advertisement
Sign in to follow this  
mrMatrix

2D Smooth "infinity" ortho zoom

Recommended Posts

I'm wondering if I'm missing any steps or making incorrect assumptions anywhere in creating an "infinite zoom" effect in a viewport similar to what happens in the software Mischief where you can pan LRUD and zoom in and out. Mischief claims trillions of levels of zoom.

w2jsLCG.jpg

In this prototype in Maya as you can see I have a front facing orthographic camera and a tree-like structure of 1x1 planes that have been scaled down and/or translated in Z. Imagine the planes as having arbitrarily sized textures on them. Later I want this to be in 3D stereo or VR with depth playing a factor as well as size. I am prototyping this in Maya before I move it to my engine in GL with GLM.

 

I can successfully zoom the ortho camera and set camera bookmarks that I can recall. However I quickly run out of camera zoom resolution as the zoom parameter approaches zero. For example in this scene pictured above I only have 24 1x1 planes but when I'm zoomed far enough in that I can only see the smallest one, the camera zoom is near zero, (even if I query the internal double value), everything starts to shake, and I can't really go any smaller than 0. With mischief, I can zoom in way deeper, to where I haven't found a limit, and do it smoothly.

 

How can I keep on zooming in more with ortho? I tried using a perspective cam and just transforming it, but the perspective distortion warps the perceived position of the planes too much to where once you zoom in far enough everything begins drifting behind each other. 

 

They could also be moving objects back in world space with a real flat perspective cam as they "zoom" in...?

Anotherquestion is why have I only seen this implemented in Mischief out of all the other programs? Is the implementation that difficult or not useful and if its not useful, why did the Foundry buy out the program?

Edited by mrMatrix

Share this post


Link to post
Share on other sites
Advertisement

I'm making some progress. From what I've read so far basically the algorithm is scaling individual objects up and down and disabling ortho zoom while retaining the ability to move L/R. This gives the benefit of having an ortho camera in regards to 2d plane placement always lining up and makes it so you aren't limited by hitting zero on the ortho zoom parameter.

You can write a function to calculate if the plane has scaled so much that it surrounds the screen meaning you can now cull it. Also if it gets too small you can cull it. Of course you can still move the ortho cam L/R

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!