POV-Ray : Newsgroups : povray.general : How would I do this in POV-Ray? Server Time
28 Nov 2024 12:53:03 EST (-0500)
  How would I do this in POV-Ray? (Message 1 to 6 of 6)  
From: blooflame
Subject: How would I do this in POV-Ray?
Date: 29 Dec 2006 00:10:01
Message: <web.4594a231626f25417a9334df0@news.povray.org>
I've known of POV-Ray for years but just getting around to having time to
use it for anything. Here's the general idea of something I need to do, can
I do it in POV-Ray?

I want to create a set of images, each on a virtual "sheet of glass", and
stack them together so that you see them as though looking straight through
the glass.

How would I do this? My (naive?) thought process is to define each sheet as
a "box" with dimensions proportional to how a sheet of glass is (thin
front-to-back, rectangular), then create images in the plane of one side of
the box. Boxes to be placed in space such that each one is exactly next to
the other.



Make sense?


Post a reply to this message

From: Jim Charter
Subject: Re: How would I do this in POV-Ray?
Date: 29 Dec 2006 01:29:09
Message: <4594b5b5$1@news.povray.org>
blooflame wrote:
> I've known of POV-Ray for years but just getting around to having time to
> use it for anything. Here's the general idea of something I need to do, can
> I do it in POV-Ray?
> 
> I want to create a set of images, each on a virtual "sheet of glass", and
> stack them together so that you see them as though looking straight through
> the glass.
> 
> How would I do this? My (naive?) thought process is to define each sheet as
> a "box" with dimensions proportional to how a sheet of glass is (thin
> front-to-back, rectangular), then create images in the plane of one side of
> the box. Boxes to be placed in space such that each one is exactly next to
> the other.
> 
> 
> 
> Make sense?
> 
> 
> 
Sort of.  The quick answer, in the usual spirit of enterprise around 
here, is try it and see if you get what you want.

In a sense, POV is more articulate than your description of what you 
want to do.  There are quite a few different and subtle possibilities 
along the lines you describe.

You can use a thin box and give it a material definition to simulate 
glass with the pigment definition based on the image.  You can even 
create the effect of stained class complete with caustics, reflections 
refractions and all.

You can also use a box with 0 thickness in one dimension if all you want 
is a surface to carry the image.  You could also use two triangles, a 
bicubic patch or a clipped plane or even disc to get an infinitely thin 
surface.

The image itself can be created in several ways but probably you mean an 
image_map.  An image_map can be used to control any of the texture 
elements but probably you mean the pigment.  Such a pigment could be 
give degrees of transparency overall, or be used with a mask to create 
areas of absolute transparency.  You may also be able to use a image_map 
to color media filling a thin box with the image you want.

You should be aware also that an image_map, as a pattern, extends 
infinitely in the z direction.


Post a reply to this message

From: Mark Birch
Subject: Re: How would I do this in POV-Ray?
Date: 29 Dec 2006 02:50:00
Message: <web.4594c87bc109b6fd430b33a0@news.povray.org>
"blooflame" <nomail@nomail> wrote:

> How would I do this? My (naive?) thought process is to define each sheet as
> a "box" with dimensions proportional to how a sheet of glass is (thin
> front-to-back, rectangular), then create images in the plane of one side of
> the box. Boxes to be placed in space such that each one is exactly next to
> the other.

That seems the simplest & most logical approach, but if you do that you're
going to get 3 problems:

1. Coincident surfaces - if you stack one box *exactly* next to the other
then Povray won't know which surface to render.  Sometimes it will render
'Box A' and sometimes it will render 'Box B'.  This isn't a problem if the
textures on 'Box A' & 'Box B' are exactly the same, but if they are
different you will get random per-pixel speckling where the surfaces
overlap.  Simple solution is to leave a very small gap between the two
objects.

2. max_trace_level - if this is set too low (the default is 5) then most of
your glass sheets will end up black.  Read the docs to find out why...

3. "My image_map appears on both sides of the box" - as Jim wrote, the
image_map extends infinitely along the Z axis (with planar mapping anyway).
 This means it will appear on both the front & the back of your glass sheet,
which I'm guessing isn't what you want...

After experimenting with a few alternatives, the simplest solution to this
is to create a plain glass sheet, and put the image on a seperate
2-dimensional object placed very slightly in front of the glass sheet
(coincident surfaces again).  The simplest way to make a 2-dimensional
square is with a polygon.

Do not regard this as the ONLY way to solve the problem.  This is Povray and
there are many more ways to skin a cat (or render a skinned one).  Read the
documentation, use the newsgroups & experiment with different techniques.


Post a reply to this message

From: Warp
Subject: Re: How would I do this in POV-Ray?
Date: 29 Dec 2006 06:53:01
Message: <4595019d@news.povray.org>
Mark Birch <las### [at] hotmailcom> wrote:
> 1. Coincident surfaces - if you stack one box *exactly* next to the other
> then Povray won't know which surface to render.  Sometimes it will render
> 'Box A' and sometimes it will render 'Box B'.  This isn't a problem if the
> textures on 'Box A' & 'Box B' are exactly the same, but if they are
> different you will get random per-pixel speckling where the surfaces
> overlap.  Simple solution is to leave a very small gap between the two
> objects.

  This might actually not be the case with axis-oriented boxes because
the math involved is very straightforward and predictable.
  It's still safer to leave the gap, though.

-- 
                                                          - Warp


Post a reply to this message

From: Rarius
Subject: Re: How would I do this in POV-Ray?
Date: 30 Dec 2006 19:29:33
Message: <4597046d$1@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message 
news:4595019d@news.povray.org...
> Mark Birch <las### [at] hotmailcom> wrote:
>> 1. Coincident surfaces - if you stack one box *exactly* next to the other
>> then Povray won't know which surface to render.  Sometimes it will render
>> 'Box A' and sometimes it will render 'Box B'.  This isn't a problem if 
>> the
>> textures on 'Box A' & 'Box B' are exactly the same, but if they are
>> different you will get random per-pixel speckling where the surfaces
>> overlap.  Simple solution is to leave a very small gap between the two
>> objects.
>
>  This might actually not be the case with axis-oriented boxes because
> the math involved is very straightforward and predictable.
>  It's still safer to leave the gap, though.

If all you want is a stack of images you could use a stack of plane{} 
instead of box{}... they would be quicker to render (ie less surfaces) and 
you'd only have one face per pane to worry about when it comes to 
image_map{} them.

You'll have fun getting all the alpha channel or transparency working right 
though!

And as someone else said, you'll have to up the max_trace_level...

Rarius


Post a reply to this message

From: blooflame
Subject: Re: How would I do this in POV-Ray?
Date: 30 Dec 2006 23:35:00
Message: <web.45973d66c109b6f7a9334df0@news.povray.org>
>
> If all you want is a stack of images you could use a stack of plane{}
> instead of box{}... they would be quicker to render (ie less surfaces) and
> you'd only have one face per pane to worry about when it comes to
> image_map{} them.
>
> You'll have fun getting all the alpha channel or transparency working right
> though!
>
> And as someone else said, you'll have to up the max_trace_level...
>
> Rarius

Well, I'm trying to simulate opaque painting or pasting of paper on one side
of a piece of glass, and then stacking them together so I think thin boxes
are better.

I will do some experimenting and see what's what.  Thanks all for your help.


Post a reply to this message

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