POV-Ray : Newsgroups : povray.general : Snow : Re: Snow Server Time
12 Aug 2024 23:15:04 EDT (-0400)
  Re: Snow  
From: PoD
Date: 15 Dec 1998 17:06:23
Message: <3676DD63.4190@merlin.net.au>
Spider wrote:
> 
> Ho Mike.
> I jump in here with a THANKYOU.
> I posted a line about this pice called 3D match a while up...
> Hadn't found the bounded_by statement... Or was to dumb to use it....
> 
> Thanx again...
> But, the question remains... What are the formula to test if a pont is inside a
sphere
> (useful in a few othjer progs I'm doing... ??
> 
> Well, thankya again...
> AS for the snowflakes, try a scaled sphere.... scale <0.1,1,1> or so... Then a
rotation...
> 
> //Spider
> 

Couldn't be simpler in POV,
  #if( vlength( Point - SphereCentre ) < SphereRadius )
     ...
  #end

if it's not in POV
  X = Point.x - SphereCentre.x
  Y = Point.y - SphereCentre.y
  Z = Point.z - SphereCentre.y
  D = X*X + Y*Y + Z*Z
  if( D < SphereRadius * SphereRadius )

Cheers, PoD.


Post a reply to this message

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