POV-Ray : Newsgroups : povray.binaries.images : Playing with Monsters : Re: Playing with Monsters Server Time
3 May 2024 23:52:11 EDT (-0400)
  Re: Playing with Monsters  
From: Artemia Salina
Date: 2 Jul 2006 18:03:58
Message: <pan.2006.07.02.22.03.54.579706@sheayright.com>
On Sun, 02 Jul 2006 17:32:01 -0400, Norbert Kern wrote:

> My fault, <0,0,0> doesn't work!
> I don't know, how you come to your start coordinates for trace (start), but
> if the base sphere is centered at <0,0,0>, the direction has to be -start.
> 
> Norbert Kern

Here's a the code that I'm using (with most texturing removed for clarity). The
RRand() just provides some irregularity to the final positioning of the eyes
and makes the eyeballs look in different directions (rotating them in their
sockets).

So Start would be

<-90, -90 (plus some randomness), 0>

And it would end the scanning at

<90 (plus some randomness), 90 (plus some randomness), 0>

++++++++++++

#declare BSB = sphere{0, 11 scale <1, 0.85, 1>};
#declare Norm = <0,0,0>;
#declare CntX = -90;
#declare CntY = -90;
#declare ZZ = <0,0,-1>;
#declare N1 = seed(12345);

#while(CntY < 90)
        #while(CntX < 90)
                #declare POSB = trace(BSB, <CntX, CntY + RRand(-0.95, 0.95, N1), 0>,
ZZ, Norm);

                #if (!VZero(Norm))
                merge{
                        object {Eye(Green*0.5, .70)
                                // Make eyes look in different directions
                                rotate <POSB.y*RRand(4, 20, N1), -POSB.x*RRand(4, 20,
N1), 0>
                                pigment{rgbt 1}
                        }
                        sphere{<0,0,0.55>, 0.75
                                texture{pigment{rgb <1, .9, .9>}}
                                // Flatten the spheres a bit
                                scale <1.3, 1.3, 0.95>
                                // This rotation was what I was using and it was
close:
                                // rotate <POSB.y*8, -POSB.x*8, 0>
                                rotate <degrees (atan2 (Norm.z,Norm.y)),0,-degrees
(atan2(Norm.x,Norm.y))>
                        }
                        translate POSB
                }
                #end
                #declare CntX = CntX + 3 + RRand(-0.55, 0.55, N1);
        #end
        #declare CntX = -90;
        #declare CntY = CntY + 2;
#end

-- 
Today's Alliterative Monomania Headlines:
Laputan Laryngeal Law-fall Liquidly Litters Lachrymary Law-fall
Degloried Deflective Decession Disfavorably Disincorporates Dihedral Decahedron
Redivivus Rapid-fire Refait Retroactively Roentgenizes Retrousse Redif


Post a reply to this message

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