POV-Ray : Newsgroups : povray.general : 3d math. Server Time
15 Nov 2024 19:18:52 EST (-0500)
  3d math. (Message 1 to 1 of 1)  
From: Spider
Subject: 3d math.
Date: 11 Dec 1998 09:13:47
Message: <367127F0.68DA49A8@bahnhof.se>
Hi..
I'm put at a loss with a little problem I have..
How do I, with a #while or #macro, make sure a sphere's center is inside another
sphere
???

I can't seem to succeed... I'm probably at the wrong track with this:
please note, this is from memory.


#declare Radius = 11;
#declare N = 5000;
#declare C = <0,8,0>;
#declare s = seed(pi);
#while (N>0)
   sphere {   
    C
    0.005
    pigment { White } finish { ambient 1 }
    #local vd=<rand(s)*Radius,rand(s)*Radius,rand(s)*Radius>;
    #local vld = vlength(vd-C);
    #while( (vld>Radius) & (vld<-Radius))
      #local vd=<rand(s)*Radius,rand(s)*Radius,rand(s)*Radius>;
      #local vld = vlength(vd-C);
    #end 
  }
  #declare N=N-1;
#end


Am I totally off here ???
This doesn't seem to get the desired result, but as I've understood it, the vecor
length
from the center of the sphere equals the radius of the sphere...


//Spider


Post a reply to this message

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