|
-
Jun 17th, 2010, 08:09 AM
#1
Re: Interpolating a rectangle
Even with the incredibly low bitrate parts of that look pretty nice. And it looks like the zoom and pan are very smooth!
To be honest, I actually hacked the numerical integration routine to do the required calculation when computing V while staying in the velocity domain. It just turned out that my approximation was exactly the routine required with the magic number tweak.
I'll run through a cut-down example. Say the magnification level M(t) happens to be 1, 2, and then 4 for a three frame animation. The rate of motion at each frame is V/1, V/2, and V/4, for some constant V, so that the motion appears smooth visually. Say we need to move a total distance of D=5 units during the pan. Since distance = rate * time, and our rate is V/1, V/2, or V/4, for time steps dt between frames, we can calculate the distance panned between each frame as V/n*dt, n=1, 2, or 4. The total distance moved is then V/1*dt + V/2*dt + V/4*dt = D = 5. Thus,
V = D/(1/1*dt + 1/2*dt + 1/4*dt).
In the integral call, Start and End will always be 0 and 1, so Size is basically 1/(NumFrames+1) = dt. [It looks like maybe you'll get slightly more accurate results if you use the magic constant NumFrames+1 instead of NumFrames-1, but meh, I knew it was NumFrames possibly with an off-by-1 error, so I just tested it to see what gave basically correct results, and NumFrames-1 did .]
The integral call computes the sum of 1/M(t)*Size, with M(t) computed at each frame, with each term multiplied effectively by dt = Size. This happens to be exactly the denominator necessary to compute V in this case. It's really just a convenient coincidence.
The time you enjoy wasting is not wasted time.
Bertrand Russell
<- Remember to rate posts you find helpful.
-
Jun 17th, 2010, 10:14 AM
#2
Thread Starter
Not NoteMe
Re: Interpolating a rectangle
Yeah, i've been playing around with colouring. Currently you can place any number of colours on a scale 0..1 and it interpolates between them. If you click the fractal it calculates the iterations/maxitterations, pops up a colourchooser and adds that colour in. It's great for interactively altering a fractal's colour.
Next thing on the list is adding animateable parameters to the fractal's formulas, as such:
Code:
<Fractal name="MandelbrotAlt" maxiterations="512" resolution="1" colourscheme="NewScheme">
<FormulaParameters>
<FormulaParameter name="SinMultiplier" defaultvalue="{0,0}" />
</FormulaParameters>
<Formulas>
<Init formula="Z = 0;C = Pixel" />
<Iteration formula="Z = Z ^ 2 + C + Z.Sin() * SinMultiplier" />
<Bailout formula="Z.MagSq() >= 4" />
<Weighting formula="" />
</Formulas>
<Dimensions>
<Origin>
<ComplexNumber r="-0.5" i="0" />
</Origin>
<Size>
<ComplexNumber r="3.0" i="3.0" />
</Size>
</Dimensions>
</Fractal>
Code:
<Animation name="MandelbrotAltAnim" fractal="MandelbrotAlt" frames="500">
<KeyFrames>
<KeyFrame objectname="SinMultiplier" property="Value" frame="500" value="{1,0}" >
</KeyFrame>
</KeyFrames>
</Animation>
If i could figure out some good formula's to apply paramters to i think i should be able to get some pretty neat animations.
Last edited by SLH; Jun 18th, 2010 at 02:08 AM.
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe
"I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
Have I helped you? Please Rate my posts. 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|