POV-Ray : Newsgroups : povray.general : Wrap Grid Around Stuff Server Time: 16 Dec 2018 00:47:47 GMT
  Wrap Grid Around Stuff (Message 1 to 9 of 9)  
From: Seventy Goats
Subject: Wrap Grid Around Stuff
Date: 13 Jul 2018 14:25:01
Message: <web.5b48b50a4e3cefe9634e4bac0@news.povray.org>
Hola,
I don't have a lot of experience with POV-Ray so I have a question. What I have
now is a flat grid made of a bunch of thin, intersecting cylinders. If I place
objects (like balls or boxes or something) within the plane of the grid, is
there some relatively uncomplicated way I can make the grid stretch with the
contours of the objects?


Post a reply to this message

From: Bald Eagle
Subject: Re: Wrap Grid Around Stuff
Date: 13 Jul 2018 16:25:00
Message: <web.5b48d21def60e5b1c437ac910@news.povray.org>
"Seventy Goats" <nomail@nomail> wrote:

> is
> there some ... way I can make the grid stretch with the
> contours of the objects?

As though the object smoothly repelled them?
Perhaps - I think something related to :
http://news.povray.org/povray.binaries.images/thread/%3Cweb.5aeb88d8a270a2d1f2815b9f0%40news.povray.org%3E/

is what I'd try first.

Is this "relatively uncomplicated" - not for someone unfamiliar with POV-Ray.

I'm thinking that perhaps there might be a way to do something with a negative
black hole warp and an object pattern - but that's probably wishful thinking.

So, I'd hit Mike Williams' isosurface tutorial webpage and make the grid with a
mod() isosurface to get repeating cylinders, and then read the docs on
isosurfaces, and blobbing, and see if you can blob a sphere with your grid,
giving the sphere a negative strength.


But that might just give you a hole...

I'll have to think on this later, when it's cooler and I've had more caffeine
;)


Post a reply to this message

From: Bald Eagle
Subject: Re: Wrap Grid Around Stuff
Date: 15 Jul 2018 02:10:00
Message: <web.5b4aabe5ef60e5b1458c7afe0@news.povray.org>
"Seventy Goats" <nomail@nomail> wrote:
> is
> there some relatively uncomplicated way I can make the grid stretch with the
> contours of the objects?

Do you just want to

(a) texture the surface of the object with a grid,

(b) deform the whole x-z plane in the (x, y, and z) directions - like a heavy
ball on a rubber sheet,

(c) or spread the grid away from the object in the x and z directions, like a
knot in the grain on the surface of a piece of wood

?

And do you need this done with an "infinite" plane, or just a square?

(a) can be done with a pigment, or a uv-mapping

(b) and (c) I definitely have to think more about.


(c) might be able to be done with splines

I'm also thinking perhaps along the lines of an isosurface if something like the
following is possible:

#declare r=0.1;
#declare  CylsX = function {(mod(abs(x),2)-1)*(mod(abs(x),2)-1) + y*y + 0 - r/2}

function {
     pattern {
          pigment {
               function{CylsX(x,y,z)}
          }
          warp {
               black_hole <0.15, 0.125, 0>, 0.5
               falloff 7
               strength 1.0
          }
     }
}


But functions can get pretty hairy.
I've tried to simulate the black hole warp from scratch - but no joy.


Post a reply to this message

From: William F Pokorny
Subject: Re: Wrap Grid Around Stuff
Date: 15 Jul 2018 10:40:37
Message: <5b4b24a5@news.povray.org>
On 07/14/2018 10:05 PM, Bald Eagle wrote:
> "Seventy Goats" <nomail@nomail> wrote:
>> is
>> there some relatively uncomplicated way I can make the grid stretch with the
>> contours of the objects?
> 
> 

Good questions Bill.

In the Mike Williams vein you suggested, he posted a sample scene in 
answer to the following query back in 2006:

http://news.povray.org/povray.general/thread/%3Cweb.441831a9134eb929e606030f0%40news.povray.org%3E/

I did some function based pigment thing too a long while back, but don't 
quite remember details - and I cannot find it.

Mike's solution simpler - if it works for for seventy goats ;-).

Bill P.


Post a reply to this message

From: Bald Eagle
Subject: Re: Wrap Grid Around Stuff
Date: 15 Jul 2018 12:25:00
Message: <web.5b4b3c3fef60e5b1458c7afe0@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:

http://news.povray.org/povray.general/thread/%3Cweb.441831a9134eb929e606030f0%40news.povray.org%3E/

> I did some function based pigment thing too a long while back, but don't
> quite remember details - and I cannot find it.
>
> Mike's solution simpler - if it works for for seventy goats ;-).
>
> Bill P.

Yes, that would be along the lines of situation (a) where he could just define a
grid as a layered texture in space and have the object "in" it.

What I'm envisioning / speculating / projecting his question is: if he had a
grid composed of loose lines - like the unwoven warp and weft of a loom, then if
he placed a ball on the surface of that grid, then as the object slipped between
the cords, they would move to allow the passage of the object through a hole
that got stretched out of the way.

I think simplistically, if a repeating linear texture like wood were applied to
the plane, and then a black hole warp were added with a strength proportional to
the proximity of the object to the plane, then that might do it.   Then just
layer the same texture rotate y*90.

Style points for scaling the black hole warp in x and z according the cross
sectional dimensions of the object's bounding box.

I tried the complicated pattern function method, and just got a blank black
render.  I think pattern just returns 1 or 0 ?   So I suppose I'd have to use
that as a multiplier function rather than the base function.

It would be helpful to know how the actual black hole warp is implemented as a
pattern modifier - more info to dig up.  :)

If a 3D grid is needed, perhaps there's a way to do something based on
electrostatic repulsion, and have the grid be constructed from an array of
points that are use to build splines / sphere sweeps.

I tried to use the mod() repeating trick of Mike Williams and then use the
non-linear scaling trick to "bend" the cylinders away from a point on the plane,
but sometimes it takes a while for me to "get" the math and have enough clarity
to implement it sanely and effectively.   ;)

Along THOSE lines, near the origin where x < 1, I figured that would give me
math problems / rendering artifacts, so I used max(r, x) [where r is some
arbitrary radius of a sphere]  Then in the function, I translate that portion of
the cylinder by using a prototype function x - (x-(max(r,x)) so that after tit
hits the radius of the object, the translation drops to zero.
That has to modified to get rid of the suddenness of the drop, and make it
dependent upon z as well, to make it curve, instead of just translating the
whole cylinder away from the point.


Post a reply to this message

From: William F Pokorny
Subject: Re: Wrap Grid Around Stuff
Date: 15 Jul 2018 13:46:37
Message: <5b4b503d$1@news.povray.org>
On 07/15/2018 08:21 AM, Bald Eagle wrote:
> William F Pokorny <ano### [at] anonymousorg> wrote:
> 
>
http://news.povray.org/povray.general/thread/%3Cweb.441831a9134eb929e606030f0%40news.povray.org%3E/
> 
>> I did some function based pigment thing too a long while back, but don't
>> quite remember details - and I cannot find it.
>>
>> Mike's solution simpler - if it works for for seventy goats ;-).

"for for" Ah the junk I write... So wish my eye-brain circuitry was 
better. On writing I can read something like that fifty times and not 
"see" the mistake. I come back to it later and it's obvious. Aging is 
not helping - I'm headed for complete gibberish. :-)

>>
>> Bill P.
> 
> Yes, that would be along the lines of situation (a) where he could just define a
> grid as a layered texture in space and have the object "in" it.
> 
> What I'm envisioning / speculating / projecting his question is: if he had a
> grid composed of loose lines - like the unwoven warp and weft of a loom, then if
> he placed a ball on the surface of that grid, then as the object slipped between
> the cords, they would move to allow the passage of the object through a hole
> that got stretched out of the way.
> 
> I think simplistically, if a repeating linear texture like wood were applied to
> the plane, and then a black hole warp were added with a strength proportional to
> the proximity of the object to the plane, then that might do it.   Then just
> layer the same texture rotate y*90.
> 
> Style points for scaling the black hole warp in x and z according the cross
> sectional dimensions of the object's bounding box.
> 
> I tried the complicated pattern function method, and just got a blank black
> render.  I think pattern just returns 1 or 0 ? 

Patterns - except the new potential pattern in 3.8 - are clamped to a 0 
to 1 range as I recall.

   So I suppose I'd have to use
> that as a multiplier function rather than the base function.
> 
> It would be helpful to know how the actual black hole warp is implemented as a
> pattern modifier - more info to dig up.  :)

Patterns are evaluated at a point in space. The warp feature moves that 
point before doing the pattern evaluation. The black_hole warp is the 
same except the point's movement - only push or pull relative to the 
origin currently - is constrained so as to happen only within one or 
more spherical spaces.

> 
> If a 3D grid is needed, perhaps there's a way to do something based on
> electrostatic repulsion, and have the grid be constructed from an array of
> points that are use to build splines / sphere sweeps.
> 

Somewhere on the newsgroups is a series of postings regarding point 
charges and plotting equal-potential contours and field lines about 
them. The calc got rolled into one large function so performance 
degraded badly as the number of points increased.

Bill P.


Post a reply to this message

From: Seventy Goats
Subject: Re: Wrap Grid Around Stuff
Date: 16 Jul 2018 14:55:01
Message: <web.5b4cb184ef60e5b1634e4bac0@news.povray.org>
"Seventy Goats" <nomail@nomail> wrote:
> Hola,
> I don't have a lot of experience with POV-Ray so I have a question. What I have
> now is a flat grid made of a bunch of thin, intersecting cylinders. If I place
> objects (like balls or boxes or something) within the plane of the grid, is
> there some relatively uncomplicated way I can make the grid stretch with the
> contours of the objects?

Hey, thanks a lot for all the ideas. I haven't even had a chance to try them
yet, but I'm sure it'll work out. I'm not too picky right now.

Know what happened to the dog that drank gasoline?
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
This is to give you time to think without reading straight to the answer.
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
He died.

!No hay de que:)!


Post a reply to this message

From: Seventy Goats
Subject: Re: Wrap Grid Around Stuff
Date: 16 Jul 2018 15:00:01
Message: <web.5b4cb1d7ef60e5b1634e4bac0@news.povray.org>
"Seventy Goats" <nomail@nomail> wrote:
> Hola,
> I don't have a lot of experience with POV-Ray so I have a question. What I have
> now is a flat grid made of a bunch of thin, intersecting cylinders. If I place
> objects (like balls or boxes or something) within the plane of the grid, is
> there some relatively uncomplicated way I can make the grid stretch with the
> contours of the objects?

P.S. I know I didn't answer any of your questions, but I don't need to waste any
more of your time since I think I already have what I need to know.


Post a reply to this message

From: Stephen
Subject: Re: Wrap Grid Around Stuff
Date: 16 Jul 2018 18:35:44
Message: <5b4ce580$1@news.povray.org>
On 16/07/2018 15:53, Seventy Goats wrote:
> He died.

There is a job of court jester, free. ;)


-- 

Regards
     Stephen


Post a reply to this message

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