POV-Ray : Newsgroups : povray.advanced-users : 3D Sinewave Server Time
27 Dec 2024 04:47:59 EST (-0500)
  3D Sinewave (Message 1 to 10 of 11)  
Goto Latest 10 Messages Next 1 Messages >>>
From: Ken
Subject: 3D Sinewave
Date: 12 Oct 1999 16:40:40
Message: <38039C86.6495FF94@pacbell.net>
Using this code I can create a 2D representation of a sinewave in
the x/y plane:

#declare i=0;
  #while (i<90)
    sphere {0,1 pigment {rgb <1,0,0>}finish {ambient 1.0}
    translate <i,10*sin(i*pi/30),0>}
  #declare i = i + 1;
#end

  Is it possible to extend (not extrude) the sine wave pattern into the
z plane as well ?

  The final result if I can describe it correctly would be alternating
mounds and valleys.

Anyone ?

-- 
Ken Tyler -  1100+ Povray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: Peter Popov
Subject: Re: 3D Sinewave
Date: 12 Oct 1999 19:27:48
Message: <w8IDOHDO5OcrUhoHNT=1YMVHBQNX@4ax.com>
On Tue, 12 Oct 1999 13:39:34 -0700, Ken <tyl### [at] pacbellnet> wrote:

>  Is it possible to extend (not extrude) the sine wave pattern into the
>z plane as well ?
>
>  The final result if I can describe it correctly would be alternating
>mounds and valleys.
>
>Anyone ?

Try:

#declare X=-50;
#while (X<50)
  #declare Z=-50;
  #while (Z<50)
    sphere { <X,5*sin((X+Z)/30),Z>,1 }
    #declare Z=Z+1;
  #end;
  #declare X=X+1;
#end

Unchecked!!!


Peter Popov
ICQ: 15002700


Post a reply to this message

From: Ken
Subject: Re: 3D Sinewave
Date: 12 Oct 1999 19:55:07
Message: <3803CA1B.889E7692@pacbell.net>
Peter Popov wrote:

> Try:
> 
> #declare X=-50;
> #while (X<50)
>   #declare Z=-50;
>   #while (Z<50)
>     sphere { <X,5*sin((X+Z)/30),Z>,1 }
>     #declare Z=Z+1;
>   #end;
>   #declare X=X+1;
> #end
> 
> Unchecked!!!

Thanks Peter but this gives an extruded sine. Maybe it's my explaination.
I'll try to make a csg example and post it later in pbi.

-- 
Ken Tyler -  1100+ Povray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: Peter Popov
Subject: Re: 3D Sinewave
Date: 12 Oct 1999 20:20:38
Message: <wM8DOP6D1RKujo1QWpBTxzgdrTVH@4ax.com>
On Tue, 12 Oct 1999 16:54:03 -0700, Ken <tyl### [at] pacbellnet> wrote:

>Thanks Peter but this gives an extruded sine. Maybe it's my explaination.
>I'll try to make a csg example and post it later in pbi.

No, Ken, your explanation is perfectly clear and I have even seen the
thing animated realtime (on a 486 DX40) but my math is wrong.

POV finished rendering (maybe I should post the result? Haven't posted
a pic in a #while...) so I will check my formula and post a bit later
(half an hour?)


Peter Popov
ICQ: 15002700


Post a reply to this message

From: Chris Huff
Subject: Re: 3D Sinewave
Date: 12 Oct 1999 20:29:24
Message: <3803D2DF.677D27AC@compuserve.com>
I think this:
#declare X=-50;
#while (X<50)
  #declare Z=-50;
  #while (Z<50)
    sphere { <X,5*(sin(X/30) +sin(Z/30)),Z>,1 }
    #declare Z=Z+1;
  #end;
  #declare X=X+1;
#end
will do what you want.


Post a reply to this message

From: Peter Popov
Subject: Re: 3D Sinewave
Date: 12 Oct 1999 20:36:00
Message: <dtMDOPlEzW7Ut5Dv2DTMhryV1vVm@4ax.com>
On Wed, 13 Oct 1999 03:19:37 +0300, Peter Popov <pet### [at] usanet>
wrote:

>POV finished rendering (maybe I should post the result? Haven't posted
>a pic in a #while...) so I will check my formula and post a bit later
>(half an hour?)

Here you go:

#declare X=-100;
#while (X<100)
  #declare Z=-100;
  #while (Z<100)
    #declare Y=5*sin(X/10)+5*sin(Z/6);
    sphere { <X,Y,Z>, 2 pigment { blue 1 green (10+Y)/20 } }
    #declare Z=Z+2;
  #end
  #declare X=X+2;
#end

light_source { 1000*y color rgb 1 }

camera 
{ location <20,60,-80> up y right x sky <3,10,0> look_at -35*z }

Render a swuare image. Enjoy the dive :)


Peter Popov
ICQ: 15002700


Post a reply to this message

From: Chris Huff
Subject: Re: 3D Sinewave
Date: 12 Oct 1999 20:40:24
Message: <3803D573.A275F98C@compuserve.com>
Note: I did not test this code, I actually made an isosurface with this
function:
function {y - 5*(sin(x/3) + sin(z/3))}
and a threshold of 0. Of course, this requires the Superpatch.
This has been tested:
union {
 #declare X=-50;
 #while (X<50)
   #declare Z=-50;
   #while (Z<50)
     sphere { <X,5*(sin(X/5) +sin(Z/5)),Z>,1 pigment {color Yellow}}
     #declare Z=Z+1;
   #end
   #declare X=X+1;
 #end
 scale 0.1
}


Post a reply to this message

From: Ken
Subject: Re: 3D Sinewave
Date: 12 Oct 1999 21:34:31
Message: <3803E166.FA4FE476@pacbell.net>
Chris Huff wrote:
> 
> Note: I did not test this code, I actually made an isosurface with this
> function:
> function {y - 5*(sin(x/3) + sin(z/3))}
> and a threshold of 0. Of course, this requires the Superpatch.
> This has been tested:
> union {
>  #declare X=-50;
>  #while (X<50)
>    #declare Z=-50;
>    #while (Z<50)
>      sphere { <X,5*(sin(X/5) +sin(Z/5)),Z>,1 pigment {color Yellow}}
>      #declare Z=Z+1;
>    #end
>    #declare X=X+1;
>  #end
>  scale 0.1
> }

Worked great. Thanks Chris.

-- 
Ken Tyler -  1100+ Povray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: Ken
Subject: Re: 3D Sinewave
Date: 12 Oct 1999 21:35:34
Message: <3803E1A8.6D6BBAE9@pacbell.net>
Peter Popov wrote:
> 
> On Wed, 13 Oct 1999 03:19:37 +0300, Peter Popov <pet### [at] usanet>
> wrote:
> 
> >POV finished rendering (maybe I should post the result? Haven't posted
> >a pic in a #while...) so I will check my formula and post a bit later
> >(half an hour?)
> 
> Here you go:
> 
> #declare X=-100;
> #while (X<100)
>   #declare Z=-100;
>   #while (Z<100)
>     #declare Y=5*sin(X/10)+5*sin(Z/6);
>     sphere { <X,Y,Z>, 2 pigment { blue 1 green (10+Y)/20 } }
>     #declare Z=Z+2;
>   #end
>   #declare X=X+2;
> #end
> 
> light_source { 1000*y color rgb 1 }
> 
> camera
> { location <20,60,-80> up y right x sky <3,10,0> look_at -35*z }
> 
> Render a swuare image. Enjoy the dive :)
> 
> Peter Popov
> ICQ: 15002700

Worked great. Thanks Peter.

 Swuare image ? :)

-- 
Ken Tyler -  1100+ Povray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: Remco de Korte
Subject: Re: 3D Sinewave
Date: 12 Oct 1999 23:15:10
Message: <3803F96A.11F24BD@xs4all.nl>
Ken wrote:
> 
>  Using this code I can create a 2D representation of a sinewave in
> the x/y plane:
> 
> #declare i=0;
>   #while (i<90)
>     sphere {0,1 pigment {rgb <1,0,0>}finish {ambient 1.0}
>     translate <i,10*sin(i*pi/30),0>}
>   #declare i = i + 1;
> #end
> 
>   Is it possible to extend (not extrude) the sine wave pattern into the
> z plane as well ?
> 
>   The final result if I can describe it correctly would be alternating
> mounds and valleys.
> 
> Anyone ?
> 
> --
> Ken Tyler -  1100+ Povray, Graphics, 3D Rendering, and Raytracing Links:
> http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/

If I remember right Spider did a lot of this last year.
There must still be something somewhere in the b.i.-group.

Remco


Post a reply to this message

Goto Latest 10 Messages Next 1 Messages >>>

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