POV-Ray : Newsgroups : povray.general : Object Pattern in Media Server Time
1 Nov 2024 17:20:33 EDT (-0400)
  Object Pattern in Media (Message 1 to 10 of 17)  
Goto Latest 10 Messages Next 7 Messages >>>
From: Josh
Subject: Object Pattern in Media
Date: 26 Aug 2004 04:59:21
Message: <412da669$1@news.povray.org>
Last Night I tried to create a media density pattern based on an object and
failed.

Does anyone know if this is possible?

I noted that the manual says that Object patterns are block patterns, can
these be used in density statements?


Post a reply to this message

From: Slime
Subject: Re: Object Pattern in Media
Date: 26 Aug 2004 05:03:45
Message: <412da771@news.povray.org>
> Last Night I tried to create a media density pattern based on an object
and
> failed.
>
> Does anyone know if this is possible?


That should work fine. If it's not working it's probably for some other
reason.

If I were you, I'd consider, why are you using an object{} density pattern
when you could just use the object as the container for the media itself?

Do you *have* a media container? If not, you should; otherwise it's likely
that the rays are going so far into the distance that they're just not
sampling the area where the visible media resides.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Josh
Subject: Re: Object Pattern in Media
Date: 26 Aug 2004 08:28:38
Message: <412dd776$1@news.povray.org>
> That should work fine. If it's not working it's probably for some other
> reason.
>
> If I were you, I'd consider, why are you using an object{} density pattern
> when you could just use the object as the container for the media itself?
>
> Do you *have* a media container? If not, you should; otherwise it's likely
> that the rays are going so far into the distance that they're just not
> sampling the area where the visible media resides.
>

I want to build a "object" shape for the media so that I can turbulate(real
word?) it.

The shape is/was contained in a larger sphere.

From what you say it seems that I may be having a syntax problem.

I've tried writing it as a pigment function, that can be used in a density
statement, is that the wrong way of going about it?

i.e.

declare myObject
declare myPigment, using myObject
declare myFunction using myPigment
create a sphere with interior media using myFunction as function for
density.


Post a reply to this message

From: Slime
Subject: Re: Object Pattern in Media
Date: 26 Aug 2004 13:28:15
Message: <412e1daf@news.povray.org>
> I want to build a "object" shape for the media so that I can
turbulate(real
> word?) it.

Ah.

> I've tried writing it as a pigment function, that can be used in a density
> statement, is that the wrong way of going about it?
>
> i.e.
>
> declare myObject
> declare myPigment, using myObject
> declare myFunction using myPigment
> create a sphere with interior media using myFunction as function for
> density.


That should work fine, though the creation of myPigment seems unnecessary
when you can simply use myObject directly as a pattern for the density. (I'm
pretty sure you can do just about anything to a density that you can do to a
pigment.)

Did you make the sphere (and all other surrounding objects) "hollow"?

If so, I don't know if we can help you without seeing any code.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Josh
Subject: Re: Object Pattern in Media
Date: 1 Sep 2004 09:48:38
Message: <4135d336@news.povray.org>
> If so, I don't know if we can help you without seeing any code.

My code's a mess.

Whats wrong with this snippet?

#declare myObject = union {
    cylinder    { <8,0,0>,<-8,0,0>,3 }
    sphere { <0,0,0>, 5 } } ;

... and then...

density {
    object { myObject 0,1 }
        }


...  I just keep getting various sytax checking errors with everything I
try?


Post a reply to this message

From: Slime
Subject: Re: Object Pattern in Media
Date: 1 Sep 2004 10:16:26
Message: <4135d9ba$1@news.povray.org>
> density {
>     object { myObject 0,1 }
>         }

First off, make sure that's within a media {} block. Second, it may be
necessary to use "rgb 0" and "rgb 1" instead of just "0" and "1" (though I'm
not sure that that's the case).

> ...  I just keep getting various sytax checking errors with everything I
> try?

What error are you getting?

Here is what I would try:

#declare myObject = ... // you seem to have this part correctly already

sphere { // media container
    0, 5
    pigment {rgbt 1} // clear
    interior {
        media {
            scattering {1, 1.0} // or emission or absorption or whatever you
want
            density {
                object {myObject}
                warp {turbulence .3}
                scale 2
                // whatever else
            }
        }
    }
    hollow // necessary for media to show up
}

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Josh
Subject: Re: Object Pattern in Media
Date: 1 Sep 2004 10:40:48
Message: <4135df70$1@news.povray.org>
Thanks for your help so far Slime, but neither of the examples you've
suggested has hit the nail on the head as it were.
I've included the scene below, hoping you can see the obvious thing I've
missed...  Run it to see the current syntax problem...

#include "colors.inc"

camera {
  location  <0, 5, -40> look_at   <0, 0,  0>
}

light_source {<-200, 1000, -400> White}

plane {
  y, -20
  pigment { color rgb <0.7,0.5,0.3> }
}


#declare myObject = union       {
        cylinder        {
                        <8,0,0>,
                        <-8,0,0>,
                        3
                        }
        sphere  {
                <0,0,0>
                ,5
                }
        };

 sphere {
        <0,0,0>,
        10
        texture { pigment { Clear } }
        hollow
        interior        {

          media   {
                                scattering {1, 0.1}
                                intervals 1
                                samples 5
                                method 3
                                density {
                                        object {myObject rgb 0 rgb 1}
                   }
                                }
                         }
        }


Post a reply to this message

From: Slime
Subject: Re: Object Pattern in Media
Date: 1 Sep 2004 11:24:23
Message: <4135e9a7$1@news.povray.org>
> Thanks for your help so far Slime, but neither of the examples you've
> suggested has hit the nail on the head as it were.
> I've included the scene below, hoping you can see the obvious thing I've
> missed...  Run it to see the current syntax problem...

After attempting your code, I can see that there is definitely some sort of
problem with using the object pattern in a density block. It doesn't seem to
accept any LIST_ITEM_A/B values as "3.5.11.23  Object Pattern" in the
documentation says it should, and if you don't specify anything then it says
"missing pigment".

I'm not sure if this is intended behavior. Regardless, it can be worked
around with a pigment_pattern:

density {
    pigment_pattern {object {myObject 0, 1}}
    color_map {[0 rgb 0][1 rgb 1]}
}

Which allows your scene to render.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Mike Andrews
Subject: Re: Object Pattern in Media
Date: 1 Sep 2004 11:35:00
Message: <web.4135eb3615eefcd7c717c9af0@news.povray.org>
"Josh" <som### [at] microsoftcom> wrote:
>  density { object {myObject rgb 0 rgb 1} }

using

density { pigment_pattern { object {myObject rgb 1, rgb 0 } } }

seems to work OK.

Hope this helps,

Mike.


Post a reply to this message

From: Josh
Subject: Re: Object Pattern in Media
Date: 1 Sep 2004 11:37:46
Message: <4135ecca@news.povray.org>
> After attempting your code, I can see that there is definitely some sort
of
> problem with using the object pattern in a density block. It doesn't seem
to
> accept any LIST_ITEM_A/B values as "3.5.11.23  Object Pattern" in the
> documentation says it should, and if you don't specify anything then it
says
> "missing pigment".

Yep, thats one of the errors that made me think it was my syntax

>
> I'm not sure if this is intended behavior. Regardless, it can be worked
> around with a pigment_pattern:
>
> density {
>     pigment_pattern {object {myObject 0, 1}}
>     color_map {[0 rgb 0][1 rgb 1]}
> }

Ah - ha! "pigment_pattern" is a new one on me.  There's so much to learn.

Thanks very much for you help it is appreciated.  If you add ...

                                        warp {
                                             turbulence <0,3,0>
                                             }

... to the density block, you'll see what I was attempting.

I was inspired by an image someone posted here that used media filled chess
pieces for a "Hollographic" look.

I want to try the same but have the media vaporise when the board gets shut
down.  It could be a mighty cool animation.


Post a reply to this message

Goto Latest 10 Messages Next 7 Messages >>>

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