ftp.nice.ch/pub/next/graphics/movie/MovieApp.0.02.s.tar.gz#/Fun_With_Movies/zoomspin.movie/generator.c

This is generator.c in view mode; [Download] [Up]

#import <stdio.h>
#import <math.h>

void printBaseScene(FILE* output, double x, double y, double z, double angle)
{
	fprintf(output, "v\nfrom %f %f %f\nat 0 0 0\nup 0 0 1\n", x, y, z);
	fprintf(output, "angle %f\n", angle);
	fprintf(output, "hither 1\nresolution %d %d\n", RESOLUTION, RESOLUTION);
	fprintf(output, "b SkyBlue\nl 4 3 2\nl 1 -4 4\nl -3 1 5\n");
	fprintf(output, "f yellow_green 1 0 0 0 0\np 4\n 12  12 -.5\n-12  12 -.5\n-12 -12 -.5\n 12 -12 -.5\n");
	fprintf(output, "f SteelBlue .5 .5 3 0 0\ns  0.000 -1.000 0.000 0.5\ns  0.866  0.500 0.000 0.5\ns -0.866  0.500 0.000 0.5\n");
}

void printScene(FILE *output, int frameNum)
{
	if (frameNum < 30) /* zoom in by narrowing focus */
	{ double angle;
		angle = ((double)(frameNum - 30) * (float)(frameNum - 30) * 46.5L / 900.0L) + 3.5L;
		printBaseScene(output, 0.0L, 25.0L, 10.0L, angle); 
	}
	else /* spin around 360 degrees */
	{ double angle, x, y;
		angle = (double)(frameNum - 30) * 6.28L / 30.0L; /* scale to 2Pi */
		x = sin(angle) * 25.0L;
		y = cos(angle) * 25.0L;
		printBaseScene(output, x, y, 10.0L, 3.5L);
	}
}

main()
{
	FILE *theFile;
	char filename[16];
	int i;
	
	for (i=0; i<60; i++)
	{
		sprintf(filename, "%d", i);
		strcat(filename, ".nff");
		theFile = fopen(filename, "w");
		printScene(theFile, i);
		fclose(theFile);
	}
}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.