POV-Ray : Newsgroups : povray.binaries.images : using 'object pattern' as media Server Time
19 Apr 2024 17:14:26 EDT (-0400)
  using 'object pattern' as media (Message 2 to 11 of 23)  
<<< Previous 1 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Thomas de Groot
Subject: Re: using 'object pattern' as media
Date: 29 Apr 2022 02:41:32
Message: <626b889c$1@news.povray.org>
Oooh!  LOL!

This is brilliant! Well done Kenneth.

-- 
Thomas


Post a reply to this message

From: s day
Subject: Re: using 'object pattern' as media
Date: 29 Apr 2022 06:20:00
Message: <web.626bbab0ac9c0ae1ca4c22fb6a8f0b95@news.povray.org>
This is a neat idea, I assume this could be used to control how media is shaped
for many purposes (thinking of the struggles I have had with media in the past).

I still have some unfinished Pov business if I ever have time to get back to it.
A few scenes I wanted to do with my steam train model that needed media and I
never got around to.

Sean


Post a reply to this message

From: Alain Martel
Subject: Re: using 'object pattern' as media
Date: 29 Apr 2022 09:50:43
Message: <626bed33$1@news.povray.org>
Le 2022-04-28 à 17:29, Kenneth a écrit :

> warp{...} for example). For mesh and mesh2 objects, the model requires an
> inside_vector for the media to show up. Unfortunately, bicubic_patch objects
> either don't work or don't show the media.
> 

There is a simple explanation for the bicubic_patch : That object only 
have a surface, it have zero thickness.
The same will happen with the triangle primitive.

Even if you have an union of them forming a completely closed shape, 
they'll never have an interior.

What would be required is the possibility to integrate bicubic_patch in 
a mesh.


Post a reply to this message

From: Kenneth
Subject: Re: using 'object pattern' as media
Date: 29 Apr 2022 12:35:00
Message: <web.626c0f28ac9c0ae18d86850a6e066e29@news.povray.org>
Here is another example, using a different and more complex set-up of the code--
with 'solid' high-density emission + absorption medias rather than scattering.

This one uses the object pattern as a 'pigment' (not a density)-- with some
'Bunny artwork' as the main pigment there. Some image-to-functions-to-pigment
operations were required for its final use in the media, mainly because I used
the 'once' keyword for the artwork image_map.

For the art, I found a photo on Google that looked *somewhat* like the pose of
the Stanford Bunny, then used my paint.net app to clone and shift various parts
around so that the image covered the model as projected from the front. Even
though the art is just a 2-D image_map, it projects through the entire media, so
its colors are 'in depth' throughout the Bunny. Then I added a fake shadow under
the model :-)

BTW, the Stanford Bunny mesh2 model is not quite a closed mesh-- it has some
holes on its bottom surface-- so I simply made an intersection of it with a
larger and well-placed box object, which solidified those holes. Interestingly,
this also eliminated the need for the model to have an inside_vector (for the
media appearance.)

I made several animations of this example which I will post at
binaries.animation; they rendered *much* faster than my aborted scattering-media
version, in about 1/10 the time (but with no lighting interaction of course).


Post a reply to this message


Attachments:
Download 'object_pattern_as_media_2.jpg' (372 KB)

Preview of image 'object_pattern_as_media_2.jpg'
object_pattern_as_media_2.jpg


 

From: Kenneth
Subject: Re: using 'object pattern' as media
Date: 29 Apr 2022 13:20:00
Message: <web.626c1e10ac9c0ae18d86850a6e066e29@news.povray.org>
Thomas de Groot <tho### [at] degrootorg> wrote:
> Oooh!  LOL!
>
> This is brilliant! Well done Kenneth.
>

Thanks Thomas! I know that you like using media ;-)

I plan to post the basic code for these examples, once I clean all of it up. (I
currently have four huge scene files full of comments and aborted trial code,
from the many tests and experiments I have made.)


Post a reply to this message

From: Kenneth
Subject: Re: using 'object pattern' as media
Date: 29 Apr 2022 13:55:00
Message: <web.626c2555ac9c0ae18d86850a6e066e29@news.povray.org>
Alain Martel <kua### [at] videotronca> wrote:
>
> There is a simple explanation for the bicubic_patch : That object only
> have a surface, it have zero thickness.
> The same will happen with the triangle primitive.
>
> Even if you have an union of them forming a completely closed shape,
> they'll never have an interior.
>

While testing a bicubic_patch model vs. the mesh2 Bunny, the first problem that
occurred was that the bicubic_patch version could not accept an inside_vector
(which the mesh2 can, and is required for the media to appear.) I initially
thought that was the primary reason for the patch model not showing up. So I
tried the trick of making an intersection of it with a box, to somehow
'solidify' it; but that did not work either.

My understanding of mesh/mesh2 objects and bicubic_patch objects is that they
are *both* just zero-thickness 'shells' -- so I still don't quite understand why
one works as an object pattern, while the other does not. I still have the
thought that it is due to a missing inside_vector(?). OR, the problem could be
due to the particular bicubic model I used. It is just a union of patches, but
is not a completely 'closed' one. (I made that model many years ago in an *old*
app called sPatch, and it renders OK as-is in POV-ray as a typical object... but
perhaps it has some kind of problem when I try to use it for the object
pattern.)

I should probably try a well-constructed bicubic_patch model from some other
source, to see if it works.


Post a reply to this message

From: Kenneth
Subject: Re: using 'object pattern' as media
Date: 29 Apr 2022 14:15:00
Message: <web.626c2a0dac9c0ae18d86850a6e066e29@news.povray.org>
"s.day" <s.d### [at] uelacuk> wrote:
> This is a neat idea, I assume this could be used to control how media is shaped
> for many purposes (thinking of the struggles I have had with media in the past).
>

Yes! I have not yet tried using functions for the media distortion, but other
pigment-based patterns do work for that, with the appropriate color_maps or
pigment_maps.

The neat thing about media itself is that any colors or densities of exactly 0.0
(0/255) create holes in the media-- no density. Along with warps or other
distortions, some really interesting and odd 3-D media patterns and colors can
be produced this way... especially in what I call 'solid' media (very high
density.)


Post a reply to this message

From: Bald Eagle
Subject: Re: using 'object pattern' as media
Date: 29 Apr 2022 19:50:00
Message: <web.626c7935ac9c0ae11f9dae3025979125@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:

> My understanding of mesh/mesh2 objects and bicubic_patch objects is that they
> are *both* just zero-thickness 'shells' -- so I still don't quite understand why
> one works as an object pattern, while the other does not. I still have the
> thought that it is due to a missing inside_vector(?). OR, the problem could be
> due to the particular bicubic model I used. It is just a union of patches, but
> is not a completely 'closed' one.

The issue isn't whether it's closed or not, it's what takes place under-the-hood
in POV-Ray.  Meshes are geared toward making "solid" objects by defining the
object's surface, and has the code to support such an extrapolation.  Bicubic
patches are only ever interpreted as surfaces, no matter what you do.

What you'll likely have to do is take the control points of your patches, and
run them through the Bernstein polynomial stuff that TOK, and later I did to get
the <x, y, z> of any point on the surface of the patch.

Then you can use the points and the normals, and make a mesh object.

I did that in the Bezier monograph.

I'll probably have to give you a zip of the scene and any includes, and then it
would have to be extended to create a mesh from multiple patches.


Post a reply to this message

From: Bald Eagle
Subject: Re: using 'object pattern' as media
Date: 29 Apr 2022 20:00:00
Message: <web.626c7bbaac9c0ae11f9dae3025979125@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:


> I'll probably have to give you a zip of the scene and any includes, and then it
> would have to be extended to create a mesh from multiple patches.

Have a look:


Post a reply to this message


Attachments:
Download 'beziertotriangles.zip' (6 KB)

From: Kenneth
Subject: Re: using 'object pattern' as media
Date: 30 Apr 2022 13:30:00
Message: <web.626d70edac9c0ae18d86850a6e066e29@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "Kenneth" <kdw### [at] gmailcom> wrote:
>
> > My understanding of mesh/mesh2 objects and bicubic_patch objects is that they
> > are *both* just zero-thickness 'shells' -- so I still don't quite
> > understand why one works as an object pattern, while the other does not...
>
> The issue isn't whether it's closed or not, it's what takes
> place under-the-hood in POV-Ray.  Meshes are geared toward
> making "solid" objects by defining the
> object's surface, and has the code to support such an extrapolation.  Bicubic
> patches are only ever interpreted as surfaces, no matter what you do.

Oh, I get it now.

There are two aspects of this problem that initially threw me off: The docs
about bezier_patches repeatedly refer to 'triangles', as if the patch or model
is converted to a smooth-triangle mesh 'under the hood'. At least, that's what I
took to be the meaning there... which is probably a misconception on my part(?).
The other odd thing during my render trials is that POV-ray *seems* to be
evaluating my bicubic_patch model 'successfully' in the same way it treats the
Bunny model-- that is, the render likewise slows down while evaluating the media
container shape, and the render times are about identical. Except that no
media-effect is produced. This behavior made me blame the problem simply on the
'missing inside_vector.'
>
> What you'll likely have to do is take the control points of your patches, and
> run them through the Bernstein polynomial stuff that TOK, and later I did
> to get the <x, y, z> of any point on the surface of the patch.
>
> Then you can use the points and the normals, and make a mesh object.
>

I'll take a look at the files you sent; thanks!


Post a reply to this message

<<< Previous 1 Messages Goto Latest 10 Messages Next 10 Messages >>>

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