POV-Ray : Newsgroups : povray.newusers : Detail on curved surfaces? : Re: Detail on curved surfaces? Server Time
2 Nov 2024 17:20:41 EDT (-0400)
  Re: Detail on curved surfaces?  
From: Mike Williams
Date: 6 Oct 2003 22:17:26
Message: <700CTDAtHig$EwBV@econym.demon.co.uk>
Wasn't it Dave! who wrote:
>I'm brand new 'round these parts, and I'm afraid I have a ton of questions
>that are probably really basic.  Here's the first of what will probably be
>many:
>
>I'm working on a rendering that will feature surface detail on a sphere,
>similar to the way a cylinder (of opposing color) would intersect that
>sphere.
>At the moment, I'm using this basic format:
>
>#declare thingie = union {
>   intersection {
>   cylinder {<-4,0,-20>,<-4,0,-10>,4}
>   sphere {<0,0,0>,15}
>   pigment {rgb <.6,.6,.8>}
>   sphere {<0,0,0>,15
>   clipped_by {cylinder {<-4,0,-20>,<-4,0,-10>,4 inverse}}
>   pigment {rgb <1,1,1>}
>   }
>
>That's probably not quite accurate, but I hope you get the idea.  I'm
>guessing that POV-Ray is able to do this (namely, putting a dot exactly on
>the sphere's surface) in one step rather than in a pair of
>"intersection/clipped_by" statements.

Take a look at the "object" pattern. It allows a surface to have a
different texture wherever it intersects a second invisible object. Your
thingie can be coded like this:

#declare thingie = sphere {<0,0,0>,15
  pigment {
    object {
      cylinder {<-4,0,-20>,<-4,0,-10>,4}
      rgb <1,1,1>
      rgb <.6,.6,.8>
    }
  }
}  

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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