Logo by kr0mat1k - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Visit us on facebook
 
*
Welcome, Guest. Please login or register. April 24, 2024, 11:57:07 PM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: Problems with generating frames for fractal zoom movies  (Read 4853 times)
0 Members and 1 Guest are viewing this topic.
Softology
Conqueror
*******
Posts: 120


« on: September 21, 2016, 12:37:11 AM »

Hoping someone can shed some light on this.  I have had this problem for years now and have only just revisited it hoping to fix it once and for all.

The problem is that when I generate a movie zooming into a fractal the movie gets faster as it zooms in.

Here is a recent example showing the problem
<a href="http://www.youtube.com/v/sZeJeTTsjwE&rel=1&fs=1&hd=1" target="_blank">http://www.youtube.com/v/sZeJeTTsjwE&rel=1&fs=1&hd=1</a>
You should notice that every part of the movie gets faster towards the end as the zoom gets deeper.  I want the zoom speed to be smooth from start to finish without speeding up or slowing down.

I am currently using a bezier spline to generate points from a set of control points in the form...

Code:
Point 1
XMin=-2.3
XMax=2.3
YMin=-2.1
YMax=2.1
Tween Steps=0
Point 2
XMin=-1.56595744680851
XMax=-1.10106382978723
YMin=-0.223668639053254
YMax=0.198816568047337
Tween Steps=90
Point 3
XMin=-1.39780443639656
XMax=-1.35082050701675
YMin=-0.106172753054865
YMax=-0.0636742410980008
Tween Steps=90

and this is the main bezier routine that "tweens" the points between the control points above.

Code:
    function DoBezier(p:array of SplinePoint;n:integer;mu:double):SplinePoint;
    var k,kn,nn,nkn:integer;
        blend,muk,munk:double;
        b:SplinePoint;
    begin
         b.x:=0;
         b.y:=0;
         b.z:=0;
         muk:=1;
         munk:=Power(1-mu,n);
         for k:=0 to n do
         begin
              nn:=n;
              kn:=k;
              nkn:=n-k;
              blend:=muk*munk;
              muk:=muk*mu;
              munk:=munk/(1-mu);
              while (nn >= 1) do
              begin
                   blend:=blend*nn;
                   dec(nn);
                   if (kn > 1) then
                   begin
                        blend:=blend/kn;
                        dec(kn);
                   end;
                   if (nkn > 1) then
                   begin
                        blend:=blend/nkn;
                        dec(nkn);
                   end;
              end;
              b.x:=b.x+p[k].x*blend;
              b.y:=b.y+p[k].y*blend;
              b.z:=b.z+p[k].z*blend;
         end;
         DoBezier:=b;
    end;

Any ideas why the zooms get faster?  It is almost like I need to scale the zoom steps/magnification as it goes in (this is the mu parameter above usually between 0 and 1), but how?  Any snippets of code for handling zooming that does not show this issue?

Thanks for any help.
Logged
claude
Fractal Bachius
*
Posts: 563



WWW
« Reply #1 on: September 21, 2016, 03:36:52 PM »

You're working in linear space, while perceptual scaling for zooms is logarithmic/exponential (depending which way you look at it).  No easy fix if you're using Xmin/Xmax representation, but if you switch to Xcenter/Xsize representation, you can do something like  Xsize:=exp(interpolate(log(Xsize1), log(Xsize2), ..., t)).

For a different approach:  https://mathr.co.uk/blog/2011-12-26_poincare_half-plane_metric_for_zoom_animation.html
Logged
Softology
Conqueror
*******
Posts: 120


« Reply #2 on: September 21, 2016, 11:03:33 PM »

That got me going in the right direction.  I tried logarithmic scaling but that didn't work in my case (as you suspected).

Then I tried various ease in and ease out functions.  Finally what seems to work is a variation on the Cubic Out here
http://joshondesign.com/2013/03/01/improvedEasingEquations

Rather than using
Code:
1-Math.pow(1-t,3)
I found I needed to use
Code:
1-Math.pow(1-t,1.8)
Why the 1.8 I have no idea, but it gets the zoom speed very close to consitent from start to finish.

All the code change needed was to first put the above mu variable (evenly spaced from 0 to 1) through the equation
Code:
1-Math.pow(1-t,1.8)
and then using the result as the mu variable for the DoBezier function.

I do need to change to the more logical Xcenter/Ycenter/Zoom positioning one of these days.

Thanks for the pointer.
Logged
Pages: [1]   Go Down
  Print  
 
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.155 seconds with 24 queries. (Pretty URLs adds 0.016s, 2q)