POV-Ray : Newsgroups : povray.general : texture csg difference? Server Time
11 Aug 2024 17:20:35 EDT (-0400)
  texture csg difference? (Message 1 to 10 of 10)  
From: ingo
Subject: texture csg difference?
Date: 23 Jun 1999 13:01:52
Message: <37711300@news.povray.org>
In the POV-Doc, chapter CSG difference it says:

"We render the scene to see the position of the cylinder. We will place a
difference block around both the lens-shaped intersection and the cylinder like
this:

difference {
  intersection {
    sphere { <0, 0, 0>, 1
      translate -0.5*x
    }
    sphere { <0, 0, 0>, 1
      translate 0.5*x
    }
    pigment { Red }
    rotate 90*y
  }
  cylinder { <0, 0, -1> <0, 0, 1>, .35
    pigment { Blue }
  }
}

We render the file again and see the lens-shaped intersection with a neat hole
in the middle of it where the cylinder was. The cylinder has been subtracted
from the intersection. Note that the pigment of the cylinder causes the surface
of the hole to be colored blue. If we eliminate this pigment the surface of the
hole will be red."

The last line gives the problem. If you delete pigment{Blue}, the hole in the
lens is black.
- Is the POV-Doc in error?
- Is it a bug in POV-Ray?
- If the first is true, can POV-Ray be changed in such a way that it can also
behave like described in the doc?

ingo

--
Met dank aan de muze met het glazen oog.


Post a reply to this message

From: Mike
Subject: Re: texture csg difference?
Date: 23 Jun 1999 14:26:25
Message: <37712520.203E4010@aol.com>
I guess it's an error in the docs, since the default color for an object is black.
If you put a pigment in difference, it will override the pigment of any object
without one specified, but it doesn't say anything about that in what you posted.

-Mike


Post a reply to this message

From: Ron Parker
Subject: Re: texture csg difference?
Date: 23 Jun 1999 14:26:26
Message: <377126d2@news.povray.org>
On Wed, 23 Jun 1999 19:01:26 +0200, ingo wrote:
>
>The last line gives the problem. If you delete pigment{Blue}, the hole in the
>lens is black.
>- Is the POV-Doc in error?
>- Is it a bug in POV-Ray?
>- If the first is true, can POV-Ray be changed in such a way that it can also
>behave like described in the doc?

If the documentation says that, it is in error.  It would be exceedingly
difficult to do what the documentation says it does.  For example, what
color should the cylinder be in this example? (just like the one in the
docs, but with different coloring) 

difference {
  intersection {
    sphere { <0, 0, 0>, 1
      translate -0.5*x
      pigment { Green }
    }
    sphere { <0, 0, 0>, 1
      translate 0.5*x
      pigment { Yellow }
    }
    rotate 90*y
  }
  cylinder { <0, 0, -1> <0, 0, 1>, .35 }
}


Post a reply to this message

From: ingo
Subject: Re: texture csg difference?
Date: 23 Jun 1999 15:54:06
Message: <37713b5e@news.povray.org>
Ron Parker heeft geschreven in bericht <377126d2@news.povray.org>...
>If the documentation says that, it is in error.  It would be exceedingly
>difficult to do what the documentation says it does.  For example, what
>color should the cylinder be in this example? (just like the one in the
>docs, but with different coloring)
>
>difference {
> .....
>}
>
Hoped the hole could be half yellow, half green.
I have only a very vague notion of how the internals of POV-Ray function.
Can you explain me, in laymans terms, why it is so difficult to do what the doc
says?

ingo
--
Met dank aan de muze met het glazen oog.


Post a reply to this message

From: Ron Parker
Subject: Re: texture csg difference?
Date: 23 Jun 1999 16:25:14
Message: <377142aa@news.povray.org>
On Wed, 23 Jun 1999 21:54:03 +0200, ingo wrote:
>Ron Parker heeft geschreven in bericht <377126d2@news.povray.org>...
>>If the documentation says that, it is in error.  It would be exceedingly
>>difficult to do what the documentation says it does.  For example, what
>>color should the cylinder be in this example? (just like the one in the
>>docs, but with different coloring)
>>
>>difference {
>> .....
>>}
>>
>Hoped the hole could be half yellow, half green.
>I have only a very vague notion of how the internals of POV-Ray function.
>Can you explain me, in laymans terms, why it is so difficult to do what the doc
>says?

Mainly because from POV's POV (heh) the hole should be both yellow and
green.  Any point inside lens-shaped object is inside both the green 
sphere and the yellow sphere, and there isn't any reasonable way to 
determine which sphere should be ignored at any given point.  The only
way I can think of to get the results one might expect from that example
would be to figure out which surface is closest and use its color, but
that's not at all easy - there's no way to tell how far a point is from 
a given surface, only whether it's inside it or not.

It could be made to do what the docs say for the case mentioned in the 
docs, by having any untextured objects in a difference inherit the texture
of either the first object in the difference or the first object for 
which the point being tested is inside, but it still wouldn't do what 
you might expect in the case I gave.


Post a reply to this message

From: ingo
Subject: Re: texture csg difference?
Date: 23 Jun 1999 16:32:53
Message: <37714475@news.povray.org>
Ron Parker heeft geschreven in bericht <377142aa@news.povray.org>...

>Mainly because from POV's POV (heh) .........

Thanks,
I'll have to live with it :)

ingo

--
Met dank aan de muze met het glazen oog.


Post a reply to this message

From: Chris Huff
Subject: Re: texture csg difference?
Date: 23 Jun 1999 19:03:24
Message: <377168B9.C3526FFF@compuserve.com>
How would it be difficult? Just define a red default texture. Or am I
completely missing the point?


Post a reply to this message

From: ingo
Subject: Re: texture csg difference?
Date: 24 Jun 1999 04:20:18
Message: <3771ea42@news.povray.org>
Chris Huff heeft geschreven in bericht <377168B9.C3526FFF@compuserve.com>...
>How would it be difficult? Just define a red default texture. Or am I
>completely missing the point?
>
Yep,
Consider a crossection of a blob where each component has a random colour. What
colour must the box,that makes the crossection, have?

ingo
--
Met dank aan de muze met het glazen oog.


Post a reply to this message

From: Chris Huff
Subject: Re: texture csg difference?
Date: 24 Jun 1999 06:24:30
Message: <3772085B.10FABFF2@compuserve.com>
Ah, now I understand. Hmm, maybe we need a "multisphere" or
"blob_pattern" pattern. Create one of those with the same data used for
the blob, and you could fake it.


Post a reply to this message

From: Dr  Reinhard Rettelbach
Subject: Re: texture csg difference?
Date: 26 Jun 1999 14:21:50
Message: <377519D6.7E86AAF9@t-online.de>
ingo wrote:
> 
> Chris Huff heeft geschreven in bericht <377168B9.C3526FFF@compuserve.com>...

> Yep,
> Consider a crossection of a blob where each component has a random colour. What
> colour must the box,that makes the crossection, have?
> 
> ingo

not testet yet, but what's about clipped_by?

ReVerSi


Post a reply to this message

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