func random_scene() HitableList {
	var world HitableList

	world = append(world, sphere(vec3(0, -1000, 0), 1000, lambertian(0.5, 0.5, 0.5)))

	for a := -11; a < 11; a++ {
		for b := -11; b < 11; b++ {
			mat_prob := rand.Float32()
			center := vec3(float32(a)+0.9*rand.Float32(), 0.2, float32(b)+0.9*rand.Float32())

			if center.sub(vec3(4, 0.2, 0)).norm() > 0.9 {
				if mat_prob < 0.8 {
					world = append(world, sphere(center, 0.2, lambertian(
						rand.Float32()*rand.Float32(),
						rand.Float32()*rand.Float32(),
						rand.Float32()*rand.Float32())))
				} else if mat_prob < 0.95 {
					world = append(world, sphere(center, 0.2, metal(
						0.5*(1+rand.Float32()),
						0.5*(1+rand.Float32()),
						0.5*(1+rand.Float32()),
						0.5*(1+rand.Float32()),
					)))
				} else {
					world = append(world, sphere(center, 0.2, dielectric(1.5)))
				}
			}
		}
	}

	world = append(world, sphere(vec3(0, 1, 0), 1.0, dielectric(1.5)))
	world = append(world, sphere(vec3(-4, 1, 0), 1.0, lambertian(0.4, 0.2, 0.1)))
	world = append(world, sphere(vec3(4, 1, 0), 1.0, metal(0.7, 0.6, 0.5, 0.0)))
	return world
}
/* example scenes to render */
example scenes to render
/ * example scenes to render * /
func random_scene() HitableList {
	var world HitableList
	world = append(world, sphere(vec3(0, -1000, 0), 1000, lambertian(0.5, 0.5, 0.5)))
	for a := -11; a < 11; a++ {
		for b := -11; b < 11; b++ {
			mat_prob := rand.Float32()
			center := vec3(float32(a)+0.9*rand.Float32(), 0.2, float32(b)+0.9*rand.Float32())
			if center.sub(vec3(4, 0.2, 0)).norm() > 0.9 {
				if mat_prob < 0.8 {
					world = append(world, sphere(center, 0.2, lambertian(
						rand.Float32()*rand.Float32(),
						rand.Float32()*rand.Float32(),
						rand.Float32()*rand.Float32())))
				} else if mat_prob < 0.95 {
					world = append(world, sphere(center, 0.2, metal(
						0.5*(1+rand.Float32()),
						0.5*(1+rand.Float32()),
						0.5*(1+rand.Float32()),
						0.5*(1+rand.Float32()),
					)))
				} else {
					world = append(world, sphere(center, 0.2, dielectric(1.5)))
				}
			}
		}
	}
	world = append(world, sphere(vec3(0, 1, 0), 1.0, dielectric(1.5)))
	world = append(world, sphere(vec3(-4, 1, 0), 1.0, lambertian(0.4, 0.2, 0.1)))
	world = append(world, sphere(vec3(4, 1, 0), 1.0, metal(0.7, 0.6, 0.5, 0.0)))
	return world
}
func random_scene ( ) HitableList { var world HitableList world = append ( world , sphere ( vec3 ( 0 , - 1000 , 0 ) , 1000 , lambertian ( 0.5 , 0.5 , 0.5 ) ) ) for a := - 11 ; a < 11 ; a ++ { for b := - 11 ; b < 11 ; b ++ { mat_prob := rand . Float32 ( ) center := vec3 ( float32 ( a ) + 0.9 * rand . Float32 ( ) , 0.2 , float32 ( b ) + 0.9 * rand . Float32 ( ) ) if center . sub ( vec3 ( 4 , 0.2 , 0 ) ) . norm ( ) > 0.9 { if mat_prob < 0.8 { world = append ( world , sphere ( center , 0.2 , lambertian ( rand . Float32 ( ) * rand . Float32 ( ) , rand . Float32 ( ) * rand . Float32 ( ) , rand . Float32 ( ) * rand . Float32 ( ) ) ) ) } else if mat_prob < 0.95 { world = append ( world , sphere ( center , 0.2 , metal ( 0.5 * ( 1 + rand . Float32 ( ) ) , 0.5 * ( 1 + rand . Float32 ( ) ) , 0.5 * ( 1 + rand . Float32 ( ) ) , 0.5 * ( 1 + rand . Float32 ( ) ) , ) ) ) } else { world = append ( world , sphere ( center , 0.2 , dielectric ( 1.5 ) ) ) } } } } world = append ( world , sphere ( vec3 ( 0 , 1 , 0 ) , 1.0 , dielectric ( 1.5 ) ) ) world = append ( world , sphere ( vec3 ( - 4 , 1 , 0 ) , 1.0 , lambertian ( 0.4 , 0.2 , 0.1 ) ) ) world = append ( world , sphere ( vec3 ( 4 , 1 , 0 ) , 1.0 , metal ( 0.7 , 0.6 , 0.5 , 0.0 ) ) ) return world }
example scenes to render
example scenes to render