|
|
(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
|
|