POV-Ray : Newsgroups : povray.binaries.images : Playing with Monsters : Re: Playing with Monsters Server Time
6 Nov 2024 00:26:26 EST (-0500)
  Re: Playing with Monsters  
From: Anton Sherwood
Date: 4 Jul 2006 20:31:38
Message: <44ab086a$1@news.povray.org>
(oops, I hit the wrong button.)

Artemia Salina wrote:
> . . .  Please note the scaled spheres under the eye balls and how they
> are not rotated correctly to lay on the surface of the large sphere.
> I haven't been able to figure out how to do this properly yet. . . .

Can't see the discrepancy myself, but anyway .. I'd put the eye with its
mount at <R,0,0>

	#declare Eye = union {
		//the eyeball itself and
		sphere { 0,1 scale <1,2,2> translate R*x }
		}

and then rotate it into place.

For uniformly random placement this is the way to go:

	object { Eye
		rotate <0,
		 degrees(asin(1-2*rand(Seed))),
		 360*rand(Seed)>
		}

For a uniform quasi-grid placement:

	#declare H = 1/N;
	#declare Z = H-1;
	#declare Theta = 0;
	#declare Magic = 180*(3-sqrt(5));
	#while Z < 1
		object { Eye rotate <0, degrees(asin(Z)), Theta> }
		#declare Z = Z+2*H;
		#declare Theta = mod(Theta+Magic,360);
	#end//while

-- 
Anton Sherwood, http://www.ogre.nu/
"How'd ya like to climb this high *without* no mountain?" --Porky Pine


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.