POV-Ray : Newsgroups : povray.newusers : rendering of a wobbeling plane Server Time
1 Nov 2024 14:16:36 EDT (-0400)
  rendering of a wobbeling plane (Message 1 to 9 of 9)  
From: atomman
Subject: rendering of a wobbeling plane
Date: 18 Apr 2008 08:35:00
Message: <web.480894aeba6c6c0688e0656b0@news.povray.org>
Hi I'm new to POV-Ray.

How do I arrange object in space so that they form a plane which normal wobbles
in a random fashion, while the objects them self still is connected smoothly?

the situations is a little bit like rendering spheres floating in a wavy sea

Thanks


Post a reply to this message

From: Alain
Subject: Re: rendering of a wobbeling plane
Date: 18 Apr 2008 12:01:16
Message: <4808c5cc@news.povray.org>
en ce 2008/04/18 08:31 :)   ->
> Hi I'm new to POV-Ray.
> 
> How do I arrange object in space so that they form a plane which normal wobbles
> in a random fashion, while the objects them self still is connected smoothly?
> 
> the situations is a little bit like rendering spheres floating in a wavy sea
> 
> Thanks
> 
> 
> 
> 
Just start with evenly spaced points in an array. Now, apply some vturbulence to 
each point.
Now that your points are shifted from ther original locations, just use loops to 
place and connect them. Your objects will be moved on all 3 axis from ther 
original locations.

-- 
Alain
-------------------------------------------------
You know you've been raytracing too long when a co-worker nearly kills himself 
over losing an hour's worth of work after a computer crash, and you just calmly 
shrug your shoulders and say, "Is that all?"
Taps a.k.a. Tapio Vocadlo


Post a reply to this message

From: Sherry Shaw
Subject: Re: rendering of a wobbeling plane
Date: 18 Apr 2008 12:12:24
Message: <4808c868@news.povray.org>
atomman wrote:
> 
> How do I arrange object in space so that they form a plane which normal wobbles
> in a random fashion, while the objects them self still is connected smoothly?
> 
> the situations is a little bit like rendering spheres floating in a wavy sea
> 

I was just looking at http://www.f-lohmueller.de/pov_tut/pov__eng.htm in 
reference to the previous thread, and I think some of the material there 
might be similar to what you're looking for (especially tutorial number 
X, which involves using the trig functions to place spheres in wavy 
patterns).

Hope this helps,

--Sherry Shaw


-- 
#macro T(E,N)sphere{x,.4rotate z*E*60translate y*N pigment{wrinkles scale
.3}finish{ambient 1}}#end#local I=0;#while(I<5)T(I,1)T(1-I,-1)#local I=I+
1;#end camera{location-5*z}plane{z,37 pigment{granite color_map{[.7rgb 0]
[1rgb 1]}}finish{ambient 2}}//                                   TenMoons


Post a reply to this message

From: Larry Hudson
Subject: Re: rendering of a wobbeling plane
Date: 19 Apr 2008 00:11:47
Message: <48097103$1@news.povray.org>
Sherry Shaw wrote:
> atomman wrote:
> 
>>
>> How do I arrange object in space so that they form a plane which 
>> normal wobbles
>> in a random fashion, while the objects them self still is connected 
>> smoothly?
>>
>> the situations is a little bit like rendering spheres floating in a 
>> wavy sea
>>
> 
> I was just looking at http://www.f-lohmueller.de/pov_tut/pov__eng.htm in 
> reference to the previous thread, and I think some of the material there 
> might be similar to what you're looking for (especially tutorial number 
> X, which involves using the trig functions to place spheres in wavy 
> patterns).
> 
> Hope this helps,
> 
> --Sherry Shaw
> 
Hmmm...  I read atomman's question to mean he wants to use normals to 
the plane to create "wobbles" or undulations and have the objects remain 
in contact with these undulations.  The problem is that normals don't 
create real displacements to the surface, so the plane actually remains 
a totally flat plane, it just has the visual appearance of 
displacements.  So I don't think he can do what he wants by simply using 
normals and this will have to be approached differently -- isosurfaces 
perhaps?

OTOH, maybe I'm the one misreading his question...    ;-)

      -=- Larry -=-


Post a reply to this message

From: Mike Williams
Subject: Re: rendering of a wobbeling plane
Date: 19 Apr 2008 01:36:55
Message: <grzj4gACLYCIFwtR@econym.demon.co.uk>
Wasn't it Larry Hudson who wrote:

>Hmmm...  I read atomman's question to mean he wants to use normals to
>the plane to create "wobbles" or undulations and have the objects
>remain in contact with these undulations.  The problem is that normals
>don't create real displacements to the surface, so the plane actually
>remains a totally flat plane, it just has the visual appearance of
>displacements.  So I don't think he can do what he wants by simply
>using normals and this will have to be approached differently --
>isosurfaces perhaps?

With isosurfaces you can do this:


#version 3.6;
global_settings {assumed_gamma 1.0}
camera {location  <4,4,-10> look_at <0,0,0> angle 20}
background {rgb 1}
light_source {<-30, 100, -30> color rgb 1}


#include "functions.inc"
#declare Scale=0.5;
#declare Height=0.5;

#declare Floor = isosurface {
  function { y - f_waves(x/Scale,y,z/Scale)*Height }
        max_gradient 1.1
        contained_by{sphere{0,5}}
        pigment {rgb <.5,.5,1>}
}

object{Floor}

#declare X=-3;
#while (X<3)
  #declare Z=-3;
  #while (Z<3)
    #declare A=<X,10,Z>;
    #declare N=<0,0,0>;
    #declare P=trace(Floor,A,-y,N);
    cylinder {P, P+N*0.2, 0.02 pigment {rgb <1,1,0>}}
    #declare Z=Z+0.5;
  #end
  #declare X=X+0.5;
#end

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: atomman
Subject: Re: rendering of a wobbeling plane
Date: 19 Apr 2008 08:25:01
Message: <web.4809e3b6aed4a5916d3c682b0@news.povray.org>
Hi,
Thanks for all the nice suggestions.

> Just start with evenly spaced points in an array. Now, apply some vturbulence to
> each point.
> Now that your points are shifted from ther original locations, just use loops to
> place and connect them. Your objects will be moved on all 3 axis from ther
> original locations.

I think the turbulence option fits my need the best. But I'm not quite there
yet. Hers my preliminary code:

#############################################################################
#include "colors.inc"
#include "shapes.inc"
#include "math.inc"
#include "transforms.inc"
#include "analytical_g.inc"

  camera {
    location <-20, 20, -12>
    look_at <15,0,15>
  }
light_source{<2500,2500,-1500> color White}
sky_sphere{ pigment{ gradient <0,1,0>
                     color_map{ [0   color rgb<1,1,1>         ]//White
                                [0.4 color rgb<1,1,1>]//~Navy
                                [0.6 color rgb<1,1,1>]//<0.14,0.14,0.56>]//~Navy
                                [1.0 color rgb<1,1,1>         ]//White
                              }
                     scale 2 }
           }
 #declare Thicknes =6;

#declare molecule =
 union{
 sphere{<0,0,0>,1
   texture{
     pigment{color Red}
     finish {diffuse 0.9 phong 1}
     }// end of texture
    no_shadow
 }// end of sphere

 cylinder{<0.2,0,0.2>,
  <0.2,-Thicknes/2.2,0.2>,
  0.1
  texture{
   pigment{color rgb<1,0.65,0.0>}
 }
  no_shadow
 }
 cylinder{<-0.2,0,-0.2>,
  <0.2,-Thicknes/2.2,0.2>,
  0.1
  texture{
   pigment{color rgb<1,0.65,0.0>}
 }
  no_shadow
 }
 }

 #declare bi_molecule =
 union{
 object{
         molecule}
 object{ molecule
         rotate <0,0,180>
         translate < 0, -Thicknes,0>}
         }
 #declare S = 50;


#declare Z = 0;
#declare EndZ = S;
#declare Step = 1;

#while ( Z < EndZ + Step)

  #declare X = 0;
  #declare EndX = S;

  #while ( X < EndX + Step)
    #declare R = 0;
    //vturbulence(Lambda, Omega, Octaves, A)
     #declare A = <X,R,Z> + 1.5*vturbulence(0, 0, 1,<X,R,Z>)*<0,1,0>;
     object{ bi_molecule
     translate A}

  #declare X = X+Step;
  #end

#declare Z = Z+Step;
#end

############################################################################

Maybe I don't get the parameters for vturbulence because I can't get the surface
to be random at larger distances while being less random at shorter distances.

Any thoughts?


Post a reply to this message

From: Alain
Subject: Re: rendering of a wobbeling plane
Date: 19 Apr 2008 13:44:58
Message: <480a2f9a@news.povray.org>
en ce 2008/04/19 08:21 :)   ->
> Hi,
> Thanks for all the nice suggestions.
> 
>> Just start with evenly spaced points in an array. Now, apply some vturbulence to
>> each point.
>> Now that your points are shifted from ther original locations, just use loops to
>> place and connect them. Your objects will be moved on all 3 axis from ther
>> original locations.
> 
> I think the turbulence option fits my need the best. But I'm not quite there
> yet. Hers my preliminary code:
> 
>
> ############################################################################
> 
> Maybe I don't get the parameters for vturbulence because I can't get the surface
> to be random at larger distances while being less random at shorter distances.
> 
> Any thoughts?
> 
> 
> 
> 
> 
> 
Try this:
      #declare A = <X,R,Z> + 1.5*vturbulence(1.5, 0.45, 2,<X/5,R,Z/5>)*<0,1,0>;

The first argument (lambda) determine the randommness of the steps. Usual values 
range from 1 to 2. Small values mean that the steps tend to be in the same 
direction. Large values mean that the direction of a step depends less on the 
direction of the preceding setp. Float larged than zero.

The second argument (omega) determine the relative weight of a step compared to 
the preceding one. Start with 0.5. Reduce for a smoother result. Float larger 
than zero up to 1.

The third argument (octaves) determine how many steps are used to perturb the 
positions. Increase to get more small scale perturbation. Integer values only.

By dividine X and Z by 5, I effectively spreaded the perturbations, equivalent 
to scaling the pattern by 5 horizontaly.

Now, it makes smooth, irregular, ondulations.

Unless you use all those includes elsewhere, you realy only use colors.inc. You 
can remove all other includes.

-- 
Alain
-------------------------------------------------
You know you've been raytracing too long when you've gained twenty pounds 
sitting at the computer, but can't tell because your beard covers your stomach.
Taps a.k.a. Tapio Vocadlo


Post a reply to this message

From: atomman
Subject: Re: rendering of a wobbeling plane
Date: 19 Apr 2008 13:55:00
Message: <web.480a317daed4a591d5a8f8080@news.povray.org>
Alain <ele### [at] netscapenet> wrote:
> en ce 2008/04/19 08:21 :)   ->
> > Hi,
> > Thanks for all the nice suggestions.
> >
> >> Just start with evenly spaced points in an array. Now, apply some vturbulence to
> >> each point.
> >> Now that your points are shifted from ther original locations, just use loops to
> >> place and connect them. Your objects will be moved on all 3 axis from ther
> >> original locations.
> >
> > I think the turbulence option fits my need the best. But I'm not quite there
> > yet. Hers my preliminary code:
> >
> >
> > ############################################################################
> >
> > Maybe I don't get the parameters for vturbulence because I can't get the surface
> > to be random at larger distances while being less random at shorter distances.
> >
> > Any thoughts?
> >
> >
> >
> >
> >
> >
> Try this:
>       #declare A = <X,R,Z> + 1.5*vturbulence(1.5, 0.45, 2,<X/5,R,Z/5>)*<0,1,0>;
>
> The first argument (lambda) determine the randommness of the steps. Usual values
> range from 1 to 2. Small values mean that the steps tend to be in the same
> direction. Large values mean that the direction of a step depends less on the
> direction of the preceding setp. Float larged than zero.
>
> The second argument (omega) determine the relative weight of a step compared to
> the preceding one. Start with 0.5. Reduce for a smoother result. Float larger
> than zero up to 1.
>
> The third argument (octaves) determine how many steps are used to perturb the
> positions. Increase to get more small scale perturbation. Integer values only.
>
> By dividine X and Z by 5, I effectively spreaded the perturbations, equivalent
> to scaling the pattern by 5 horizontaly.
>
> Now, it makes smooth, irregular, ondulations.
>
> Unless you use all those includes elsewhere, you realy only use colors.inc. You
> can remove all other includes.
>
> --
> Alain
> -------------------------------------------------
> You know you've been raytracing too long when you've gained twenty pounds
> sitting at the computer, but can't tell because your beard covers your stomach.
> Taps a.k.a. Tapio Vocadlo


Thank you very much!
This is excatly what I am looking for.


Post a reply to this message

From: Sherry Shaw
Subject: Re: rendering of a wobbeling plane
Date: 19 Apr 2008 23:26:41
Message: <480ab7f1@news.povray.org>
Larry Hudson wrote:
> 
> Hmmm...  I read atomman's question to mean he wants to use normals to 
> the plane to create "wobbles" or undulations and have the objects remain 
> in contact with these undulations.  The problem is that normals don't 
> create real displacements to the surface, so the plane actually remains 
> a totally flat plane, it just has the visual appearance of 
> displacements.  So I don't think he can do what he wants by simply using 
> normals and this will have to be approached differently -- isosurfaces 
> perhaps?
> 
> OTOH, maybe I'm the one misreading his question...    ;-)
> 
>      -=- Larry -=-

Well, I took it as a wobbling surface, not necessarily a plane, which 
could be simulated by placing many objects (spheres or boxes, maybe) 
close together, or else built as an isosurface.  In either case, I think 
the Lohmueller site might be useful (either for the surface or for 
placing the other objects)...but, at the very least, it's got some 
really nice pictures.  ;)  And you can always learn stuff there.

--Sherry Shaw


-- 
#macro T(E,N)sphere{x,.4rotate z*E*60translate y*N pigment{wrinkles scale
.3}finish{ambient 1}}#end#local I=0;#while(I<5)T(I,1)T(1-I,-1)#local I=I+
1;#end camera{location-5*z}plane{z,37 pigment{granite color_map{[.7rgb 0]
[1rgb 1]}}finish{ambient 2}}//                                   TenMoons


Post a reply to this message

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