Skip to content
Browse files

Removed some old junk during failed attempts to make zooming work bet…

…ter.
  • Loading branch information...
1 parent 1760742 commit a1be4c77ae849c44aeb7ac441951c3f3c0500703 @jmstacey committed May 25, 2009
Showing with 11 additions and 65 deletions.
  1. +11 −65 FractalMovie.m
View
76 FractalMovie.m
@@ -107,14 +107,11 @@ - (void)createMovieBGThread
long long timeValue = timeScale / frameRate;
QTTime movieDuration = QTMakeTime(timeValue, timeScale);
-
// Set current working position variables
x = startX;
y = startY;
step = startStep;
- // I need to figure out somehow what deltas to start with befor the quadratic part
-
// Calculate deltas
xDelta = (startX - endX) / frameCount;
yDelta = (startY - endY) / frameCount;
@@ -126,40 +123,30 @@ - (void)createMovieBGThread
[progressWindow setFrameDetails:[NSString stringWithFormat:@"%d / %d frames", 0, frameCount]];
progressBarDelta = 100 / (double)frameCount;
- NSLog(@"starting: %e, %e, %e", x, y, step);
- NSLog(@"ending: %e, %e, %e", endX, endY, endStep);
- NSLog(@"delta: %e, %e, %e", xDelta, yDelta, stepDelta);
+ debug_NSLog(@"starting: %e, %e, %e", x, y, step);
+ debug_NSLog(@"ending: %e, %e, %e", endX, endY, endStep);
+ debug_NSLog(@"delta: %e, %e, %e", xDelta, yDelta, stepDelta);
// Generate frames
for (int i = 0; i <= frameCount && ![progressWindow abort]; i++)
{
- //fractalFrame = [[Mandelbrot alloc] initWithFrameHeight:frameHeight frameWidth:frameWidth viewX:x viewY:y viewStep:step objectController:objectController];
- //frame = [fractalFrame createFrame];
-//
-// frameData = [[NSData alloc] initWithData:[frame representationUsingType:NSPNGFileType properties:nil]];
-// // Don't forget to change movieAttrs if there's a new codec
-//
-// tmpFrame = [[NSImage alloc] initWithData:frameData];
-// [movie addImage:tmpFrame forDuration:movieDuration withAttributes:movieAttrs];
+ fractalFrame = [[Mandelbrot alloc] initWithFrameHeight:frameHeight frameWidth:frameWidth viewX:x viewY:y viewStep:step objectController:objectController];
+ frame = [fractalFrame createFrame];
- NSLog(@"");
- NSLog(@"d: %e, %e, %e", xDelta, yDelta, stepDelta);
- NSLog(@"%i: %e, %e, %e", i, x, y, step);
- NSLog(@"");
+ frameData = [[NSData alloc] initWithData:[frame representationUsingType:NSPNGFileType properties:nil]];
+ // Don't forget to change movieAttrs if there's a new codec
- xDelta = xDelta - [self quadraticX:xDelta];
- yDelta = yDelta - [self quadraticX:yDelta];
- stepDelta = stepDelta - [self quadraticX:stepDelta];
+ tmpFrame = [[NSImage alloc] initWithData:frameData];
+ [movie addImage:tmpFrame forDuration:movieDuration withAttributes:movieAttrs];
// Update coordinates
x -= xDelta;
y -= yDelta;
step -= stepDelta;
- //NSString *filename = [NSString stringWithFormat:@"/Users/jon/Desktop/debug/%i.jpg", i];
-
- //[[frame representationUsingType:NSPNGFileType properties:nil] writeToFile:filename atomically:YES];
+ NSString *filename = [NSString stringWithFormat:@"/Users/jon/Desktop/debug/%i.jpg", i];
+ [[frame representationUsingType:NSPNGFileType properties:nil] writeToFile:filename atomically:YES];
// Update status window
@@ -187,46 +174,5 @@ - (void)createMovieBGThread
[progressWindow close];
}
-#pragma mark -
-#pragma mark Helper Methods
-
-- (double)quadraticX:(double)x
-{
- double y;
-
- y = pow(x, 2) + (0 * x);
-
- return y;
-}
-
-//- (double)powerOfValue:(double)value
-// raisedToPower:(double)power
-//{
-// while (power > 1)
-// {
-// value = value * value;
-// power = power - 1;
-// }
-//
-// return value;
-//}
-
-
-- (double)blasted:(double)value
-{
- double retVal;
- if (value > 0)
- {
- retVal = sqrt(value);
- }
- else
- {
- retVal = sqrt(fabs(value));
- retVal *= -1;
- }
-
- return retVal;
-}
-
@end

0 comments on commit a1be4c7

Please sign in to comment.
Something went wrong with that request. Please try again.