Exemplo n.º 1
0
void draw_mandelbrot4(const TPixels32Ref& dst,const TViewRect& rect,const long max_iter){
    for (long y=0;y<dst.height;++y){
        for (long x=0;x<dst.width;++x) {
            double x0=(2*rect.r)*x/dst.width+rect.x0-rect.r;
            double yr=rect.r*dst.height/dst.width;
            double y0=(2*yr)*y/dst.height+rect.y0-yr;
            double iter=mandelbrot3(x0,y0,max_iter);
            dst.pixels(x,y)=coloring4(iter,max_iter);
        }
    }
}
Exemplo n.º 2
0
GLfloat* calculateColor(GLfloat u, GLfloat v){
	switch(fracCount)
	{
		case 0: 
					juliaSpecial=0.5;
					return greenJulia(u,v);
					break;
		case 1:

			juliaSpecial=0.0;
			return mandelbrot(u,v);
					break;
		case 2:

			//color=0;
			juliaSpecial=0.5;
			return mandelbrot3(u,v);
			break;
		case 3:
			//	printf("Flower\n");
				juliaSpecial=0.0;
				//color=0.0;
				return flower(u,v);
				break;
		case 4:
			//printf("Star\n");
			juliaSpecial=0.9;
			//color=45;
			return starFractal(u,v);
			break;
		case 5: 
			//printf("Julia\n");
			//color=0;
			juliaSpecial=0.5;
			return julia(u,v);
					break;
		default: 
			//printf("default\n");
			//juliaSpecial=0.0;
			fracCount=0;
			glutPostRedisplay();
			//return mandelbrot(u,v);
			break;

	}
}