|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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.
Does this make sense? Can anyone suggest a more streamlined method to
accomplish the same thing? I intend to use more complicated interplays than
circle-and-cylinder, and my current route seems largely redundant. I'm also
not
really interested in image mapping as a solution, since I'd rather stick
with
simple geometric forms at this point.
Thanks to anyone who can offer any insight.
Dave!
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Dave!" <orr### [at] no_spam_pleaseexcitecom> wrote in message
news:web.3f81b835ce1049d7f0000e6e0@news.povray.org...
> I'm brand new 'round these parts, and I'm afraid I have a ton of questions
> that are probably really basic.
Congrat's on your newness! Start asking...
> 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.
>
> #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>}
> }
>
> Does this make sense? Can anyone suggest a more streamlined method to
> accomplish the same thing? I intend to use more complicated interplays
than
> circle-and-cylinder, and my current route seems largely redundant. I'm
also
> not
> really interested in image mapping as a solution, since I'd rather stick
> with
> simple geometric forms at this point.
Yes, and unfortunately this is what CSG is all about. Only thing that might
prove simpler is to use a difference {} with 'inverse' instead. Not a great
improvement. Well, let's see:
union {
difference { // create curved faced cylinder end
cylinder {
<-4,0,-20>,<-4,0,-10>,4
}
sphere {
0,15
inverse // within is without, if you understand
}
pigment {rgb <.6,.6,.8>}
} // end difference
sphere { // sphere, of course
0,15
pigment {rgb <1,1,1>}
}
} // end union
Interestingly enough, this seems to work okay. No visible coincident
surfaces even though a hole wasn't removed from the sphere. I'd almost have
expected to see trouble with that surface (and it might, under other
viewpoints, scales, etc.).
There would need to be some kind of retainment which allows keeping of an
object after the CSG procedure. Might be a nice idea, if plausible. That
sphere would be reused without adding it in a second time, if such a thing
existed.
Maybe someone else has a thought on this.
Bob H.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
As Mike Williams was kind enough to point out:
>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>
> }
> }
>}
Now the only problem is that I'm at work and can't play around with this
until I get home. But it sounds like you've hit on exactly what I need!
Thanks so much for the quick response--I'll post again tomorrow with an
update on my progress.
Dave!
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hughes, B. wrote:
>Yes, and unfortunately this is what CSG is all about. Only thing that might
>prove simpler is to use a difference {} with 'inverse' instead. Not a great
>improvement. Well, let's see:
>
>union {
>difference { // create curved faced cylinder end
> cylinder {
> <-4,0,-20>,<-4,0,-10>,4
> }
> sphere {
> 0,15
> inverse // within is without, if you understand
> }
> pigment {rgb <.6,.6,.8>}
>} // end difference
> sphere { // sphere, of course
> 0,15
> pigment {rgb <1,1,1>}
> }
>} // end union
>
>Interestingly enough, this seems to work okay. No visible coincident
>surfaces even though a hole wasn't removed from the sphere. I'd almost have
>expected to see trouble with that surface (and it might, under other
>viewpoints, scales, etc.).
>
>There would need to be some kind of retainment which allows keeping of an
>object after the CSG procedure. Might be a nice idea, if plausible. That
>sphere would be reused without adding it in a second time, if such a thing
>existed.
>
>Maybe someone else has a thought on this.
Thanks for your input--I'll give it a try when I get home. At the very
least, the method you've described is considerably more parsimonious than
mine!
Thanks again,
Dave!
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Mike Williams suggested that I:
>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>
> }
> }
>}
Yes indeed! That was exactly what I was looking for. You'll save me
approximately a zillion hours in code-time.
Thanks once again.
Dave!
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Mike Williams wrote:
[ ... ]
>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
I was just looking for a solution to the exactly the same problem when I
found this useful thread, which worked fine. I then tried making
the intersecting invisible object partialy transparent, which didn't give
me the result I was expecting:
sphere
{
0, 5
pigment
{
object
{
sphere { <0,0,-5> 3 }
pigment { Green }
pigment
{
bozo
color_map
{
[0.5 rgbf <1,1,1,1>]
[0.5 rgbf <1,1,1,0>]
}
}
}
}
}
I had expected to see a white splodge bounded by a circle on the green
sphere, whereas it looks like a white splodge hovering infront of a
cut-away green sphere.
Is it possible to do it this way, or do I have to repeat the Green
(or whatever pattern) in the color_map or do I have to make the intersecting
object the white splodge shape ?
Thanks,
Bernard
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
In article <web.3fad268c7ae16a6a24288e880@news.povray.org>,
"Bernard Hatt" <bmh### [at] arkadydemoncouk> wrote:
> I was just looking for a solution to the exactly the same problem when I
> found this useful thread, which worked fine. I then tried making
> the intersecting invisible object partialy transparent, which didn't give
> me the result I was expecting:
This is oddly phrased, maybe you don't understand the object pattern.
There is no invisible sphere in this scene. The object pattern has a
sphere, but it is part of the pattern, not an actual object in the
scene. The result of the object pattern is one of the two parameters,
depending on whether the point being evaluated is inside or outside.
> I had expected to see a white splodge bounded by a circle on the green
> sphere, whereas it looks like a white splodge hovering infront of a
> cut-away green sphere.
A white splodge bounded by a circle...well, you're not being very
specific. This will give a circular area ranging from white to clear on
a sphere that is otherwise green. As usual, the clear portion will allow
the interior of the sphere to be seen.
> Is it possible to do it this way, or do I have to repeat the Green
> (or whatever pattern) in the color_map or do I have to make the intersecting
> object the white splodge shape ?
Are you trying to make a white shape on a green background? Here are two
ways to do that:
Make the circle texture blend from white to green:
object {sphere {< 0, 0,-5>, 3}
pigment {color Green}
pigment {bozo
color_map {
[0.5 color Green]
[0.5 rgbf <1,1,1,0>]
}
}
}
Make a layered texture with the upper layer being partly transparent and
the lower layer being green:
sphere {0, 5
texture {pigment {color Green}}
texture {
pigment {
object {sphere {< 0, 0,-5>, 3}
pigment {rgbf 1}
pigment {bozo
color_map {
[0.5 rgbf 1]
[0.5 rgb 1]
}
}
}
}
}
}
--
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Christopher James Huff wrote:
[ ... ]
>Are you trying to make a white shape on a green background? Here are two
>ways to do that:
>Make the circle texture blend from white to green:
>
> object {sphere {< 0, 0,-5>, 3}
> pigment {color Green}
> pigment {bozo
> color_map {
> [0.5 color Green]
> [0.5 rgbf <1,1,1,0>]
> }
> }
> }
>
>Make a layered texture with the upper layer being partly transparent and
>the lower layer being green:
>
>sphere {0, 5
> texture {pigment {color Green}}
> texture {
> pigment {
> object {sphere {< 0, 0,-5>, 3}
> pigment {rgbf 1}
> pigment {bozo
> color_map {
> [0.5 rgbf 1]
> [0.5 rgb 1]
> }
> }
> }
> }
> }
>}
>
>Christopher James Huff <cja### [at] earthlinknet>
>http://home.earthlink.net/~cjameshuff/
>POV-Ray TAG: chr### [at] tagpovrayorg
>http://tag.povray.org/
Great, the 2nd example is exactly what I was looking for.
I was trying to sort out how to put a bounded pattern onto an existing
patterned object.
Thanks for the quick response,
Bernard
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|