POV-Ray : Newsgroups : povray.newusers : Trace with pigments : Re: Trace with pigments Server Time
28 Jul 2024 16:25:46 EDT (-0400)
  Re: Trace with pigments  
From: Chris B
Date: 5 Jul 2008 10:28:27
Message: <486f850b@news.povray.org>
"Gyscos" <gys### [at] gmailcom> wrote in message 
news:web.486f4b04c03ce0661ba56a630@news.povray.org...
> Well, i was trying to do a macro that puts spheres on the surface of an 
> object,
> with many trace. And I w as trying to give the spheres the color of the 
> object
> in this point... But if that's not possible, well, too bad :(
>

Well here's my bestest smartass hack of the day:

If you use the inverse of the object and difference the spheres from it you 
can use the 'cutaway_textures' keyword to give the spheres the same pigment, 
normal and finish as the object (even if you don't know what they are). The 
downside to this hack is that your camera ends up technically 'inside' the 
object which will mess up interior features like media if you want to use 
them in the same scene. The upside is that it should do what you asked.

The following example illustrates the technique using a simple CSG object, 
but I think it should work with more complex objects.

Regards,
Chris B.

camera {location <0,0,-4> look_at 0 }
light_source {<-1,0 ,-4>, rgb 3}

#declare MyObject = intersection {
  box {-1,1 pigment {agate scale 2} }
  sphere {0,1.25 pigment {agate scale 2}}
}

#declare MyObjectWithSpheres = difference {
  object {MyObject inverse}
  sphere {<0,-0.3,-1.04>,0.04}
  sphere {<0.5,0.5,-1.04>,0.04}
  cutaway_textures
}

object {MyObjectWithSpheres}


Post a reply to this message

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