One of simplest DemoScene effects is RotoZoom which consists of two parts - scaled texture & rotation. Rotation is the easiest part, just simple old school angle calculation for new x/y coordinates. Texture is more tricky part. There are many ways for scaling image yet coders from demoscene quickly found a way to produce both texture and scaling it at the same time. Assuming you have generated grayscale colors from 0 to 255 if you do

	color = graycolors[x^y % 255]

you will get nice checker board. When you apply division both to X and Y then you will be scaling board up, and when you multiply in this equastion X and Y then you will be scalling down. Why? Well I will show you this in code:

	var pixels = [0,255,0,255];
	for(var x=0;x<100;x++){
		draw(pixels[x%4]);
	}

This will produce you nice black/white line. Now lets divide x by 2 and round down - what will happen? For X=0,1 you will get 0, for 2,3 - one and so on which means you will draw twice first pixel, then twice second. By dividing position of pixel you are actually scaling up texture!

So main part for rotation & drawing a texture will look like this:

//multipler - just any next number used for rotating to new angle
function DrawChecker(multipler){
	_Screen.FillWithColor(ColorPalette[0]);
	angle=multipler*Math.PI;
	cosinus_angle = Math.cos(angle);
	sinus_angle = Math.sin(angle);
    for(y=0;y<height;y++){
		 center_y=-y+halfHeight; // transform x/y to Cartesian coordinate system
         for(x=0;x<width;x++){
	        center_x=x-halfWidth;
			   
		    newx=Math.floor(cosinus_angle*center_x - center_y*sinus_angle)+center_x+halfWidth;
			newy=Math.floor(sinus_angle*center_x + center_y*cosinus_angle)+center_y+halfHeight;
		
		
			index = Math.abs((newx*multipler)^(newy*multipler))%256;
			   
			_Screen.SetPixel(x,y,ColorPalette[index]);

        }
    }
		  
	_Screen.Draw();
}

full code

And now, presentation: