POV-Ray : Newsgroups : povray.newusers : Trace with pigments : Re: Trace with pigments Server Time
28 Jul 2024 16:27:57 EDT (-0400)
  Re: Trace with pigments  
From: Alain
Date: 6 Jul 2008 12:00:33
Message: <4870ec21$1@news.povray.org>
Gyscos nous illumina en ce 2008-07-05 11:04 -->
> Humm, on my PC it doens't work, the spheres are black (I use POV-ray v3.7 b27 so
> maybe it doesn't support cutaway_textures...)
> 
> Are you sure the box stores the texture of every point of the space, not only on
> its surface ?...
The textures are defined in space. You can think of the objects as been carved 
out of the texture.
> 
> What I first wanted to do was to put spheres on the object without the object
> itself (like a wireview with spheres instead of wires).
If the object you defined and traced toward is not placed in the scene, it will 
never show.
> 
> Would something like :
> 
> object {
>   difference {
>     union {
>       object { MyObject }
>       object { MyObject invert }
>     }
>     sphere { TheSpheresToPut }
>     cutaway_texture
>   }
> invert
> }
> 
> work ?
> 
> 
The difference of any object with it's inverse is empty.
The union of any object with it's inverse is the whole space.
In your example, the union is useless and the whole thing is the same as:
sphere { TheSpheresToPut hollow}
but more complicated, and slower as you get an unbound object.

If you want to get rid of the warning about the camera been inside an object 
and/or use some media, just add the "hollow" keyword to your object.

A thing that you can do, is to define your object larger by the radius of your 
spheres and allpy the pigment. As you trace, you use eval_pigment at the points 
returned by the trace. This will return the pigment at the traced location. 
Place your sphere there and apply the returned pigment to that sphere, repeat 
for each sphere. This will give you spheres that are a solid colour. You need 
all your spheres to have the same radius. It will require more memory as each 
sphere will have it's own texture block. It will be fast as the bounding will be 
effecient, one tight and distinct bounding box for each sphere.

Another way is to define a box that is the dimention of the bounding box of your 
object plus the diameter of the largest sphere. Use an intersection of that box 
and all your spheres. Apply your texture to the whole intersection. It will use 
less memory, and the spheres will show some gradient. The rendering will be 
slower as you will have many overlaping bounding boxes, each bounding box will 
cover the whole thing and overlap every other.


-- 
Alain
-------------------------------------------------
Methodist: It's not so bad if shit happens, as long as you serve grape juice 
with it.


Post a reply to this message

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