🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

non-linear zoom in 3d

Started by
2 comments, last by Jochem 6 years, 4 months ago

Dear forum, I am trying to wrap my head around an infinite zoom / seamless loop, like this one:

https://m.imgur.com/gallery/BXr6I0G 

 

I came across solutions like this:

https://gist.github.com/steve-salmond/5952537#file-zoomcardcontroller

 

…but thats using orthographic camera and I can’t get to zoom in to other XY positions than the center.

In my simple example I have 2 quads on top of each other, facing the camera, one scaled to 100f, the smaller one to 10f. Startposition of the camera is where the first quad is fullscreen, the endposition where the smaller quad is fullscreen.


Using these next steps I can get the zoom with transform Z of the Camera working perfectly.

1. Calculate the logarithm of your start and end values, whatever they represent. Any log-base is fine.
2. Linearly interpolate between the two logarithms as usual.
3. For every step in your animation/interpolation, calculate the inverse of the chosen logarithm to determine the instantaneous linear scale.



(found here:

But as soon as I apply that to also X of Y, it does not zoom in a straight line anymore.


I also tried to move the camera over a path, controlling it with a percentage. None of the usual eases fit, EaseOutSine is close, but just not it. Applying the previous 3 steps make it even worse.


I just don’t have a clue which parameters and calculations I should take into account and which box of Pandora needs to be opened here. Can somebody please point me in the right direction?


Advertisement

Zooming about a point should be a simple matter of combining transforms, much like rotating around a pivot point. You need to apply a translation to move the center point to the origin, perform the zoom/scale, and then undo the translation (i.e. apply the inverse translation).

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

Yes, you are right! I was completely lost. I chose to scale my composition with a calculated linear animation. The XY position of this composition is instantly changed at the start of the animation. How simple, indeed.

I got lost because I tried to find the proper calculation for the start and end value of the XY positions, but it doesn't need any animation at all. Thanks for pointing this out!

This topic is closed to new replies.

Advertisement