POV-Ray : Newsgroups : povray.newusers : how to make a 2D image from 3D image : Re: how to make a 2D image from 3D image Server Time
28 Jul 2024 16:31:53 EDT (-0400)
  Re: how to make a 2D image from 3D image  
From: Alain
Date: 23 Jun 2008 13:25:07
Message: <485fdc73@news.povray.org>
vinhphunguyen nous illumina en ce 2008-06-19 03:50 -->
> Hi Chris,
> 
> I have two intersecting spheres as follows:
> 
> #declare sphere1=
> sphere{ <0,0,0>, 5.0  pigment { color Red}}
> 
> 
> #declare sphere2=
> sphere{ <7,0,0>, 5.0  pigment { color Green}}
> 
> 
> #declare grains=merge{
>   object{sphere1}
>   object{sphere2}
> }
> 
> Therefore, the common region of these two spheres has mixed color (Red and
> Green). However, I would like to have this intersection region Red colored,
> instead. I have found a way to do this: using more CSG operations
> 
> #declare grains=union{
>   object{sphere1}
>   difference{
>    object{sphere2}
>    object{sphere1}
>   }
> }
> 
> But I think that this way is time-consuming in case that I have thousand spheres
> or even more. There exists another better way for this? If so, please show me
> the way to go.
> 
> Thank you very much.
> 
> Vinh Phu
> 
> 
Simple, remove the pigments from the two original spheres and apply the red 
pigment to the complete CSG.
As your object is opaque, you should use union instead of merge. Merge is 
usefull with transparent objects when you want to remove the internal surfaces. 
It's also slower then the equivalent union.

-- 
Alain
-------------------------------------------------
For a people who are free, and who mean to remain so, a well-organized and
armed militia is their best security.
Thomas Jefferson


Post a reply to this message

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