POV-Ray : Newsgroups : povray.newusers : A "realistic" plastic hemisphere. : Re: A "realistic" plastic hemisphere. Server Time
28 Jul 2024 22:23:27 EDT (-0400)
  Re: A "realistic" plastic hemisphere.  
From: Tim Attwood
Date: 7 Jul 2007 18:34:44
Message: <46901504$1@news.povray.org>
> That got it.
>
> I had to step back a bit though, as it wouldn't let me do the differencing
> with pre-defined shapes.
>
> IOW, the example you showed works fine, but if I declare a hole and try to
> difference it as below, I wasn't able to get that to work:
>
> #declare Hole = object { cylinder {
> 0,(x*Ball_Dia),((Cam_Lens_Dia+(30*Mil))/2)
>                         rotate <0,0,(0 - Cam_Angle)>
>                         rotate <0,180,0>   //Around the vertical axis
>                       }
>
> #declare Top = difference { sphere { <0,0,0>, (Ball_Dia/2) }
>                            sphere { <0,0,0>, ((Ball_Dia/2) - Wall_Thick)}
>                            Hole
>                            plane{-y,0}
>                            material { White_Plastic }
>                            photons { target 1.0 refraction on reflection 
> on
> }
>                         }

The syntax for using #declared objects is object{Name}. For example...
#declare Holes = union{cylinder{...}cylinder{...}...};
#declare Top = difference{sphere{...}sphere{...}plane{...}};
#declare HoledTop = difference{object{Top}object{Holes}};
object{HoledTop} // draw it

> I'm also not convinced that I have the photons working right..  Photons 
> seem
> to behave differently for a union or difference than they do if I take the
> objects that would have been in the union, and do them separately.

Unions don't remove the internal surfaces, use merge to remove the internal
surfaces for partially transparent objects. Also you must make sure that
you don't have coincident surfaces, even in a difference.


Post a reply to this message

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