POV-Ray : Newsgroups : povray.general : Flower power Server Time
4 Aug 2024 00:26:31 EDT (-0400)
  Flower power (Message 11 to 20 of 24)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 4 Messages >>>
From: Mike Williams
Subject: Re: Flower power
Date: 23 Oct 2003 13:01:45
Message: <rd7WpEAGW7l$EwZc@econym.demon.co.uk>
Wasn't it Patrick Elliott who wrote:
>
>In theory:
>
>http://mathworld.wolfram.com/StarrRose.html
>
>However, since they don't actually provide the equations for it, but 
>simply assume you know how to derive it from the 2D calcs in:

They do give the method for producing the Maurer Rose
http://icl.pku.edu.cn/yujs/MathWorld/math/m/m108.htm
which can be achieved in POV like this. My guess is that the Starr Rose
just uses some other stepping algorithm, but I can't guess what. I think
the 3d effect of the Starr is an optical illusion, and that it's
actually flat like the Maurer.

This doesn't seem to be moving in the direction of isosurface flowers.

#version 3.5;
global_settings {assumed_gamma 1.0}
camera {location  <0,0,-9> look_at <0,0,0> angle 50}
background {rgb 1}
light_source {<-30, 100, -30> color rgb 1}

// ----------------------------------------
// The parameters a, n and d are the same as those on  
// http://mathworld.wolfram.com/Rose.html
// and
// http://icl.pku.edu.cn/yujs/MathWorld/math/m/m108.htm
// i.e. a = scale
//      n = petal number
//      d = step length in degrees
//
// Lines = number of lines to be drawn
// Width = width of line
//
#macro Maurer(a,n,d,Lines,Width)
 union {
 #local rad=radians(d);
 #local T=0;
 #while (T < 2*pi)
  #local r=a * sin(n*T);
  #local X=r*sin(T);
  #local Y=r*cos(T);
  #local r2=a * sin(n*T+rad);
  #local X2=r2*sin(T+rad); 
  #local Y2=r2*cos(T+rad);
  #if (X!=X2 | Y!=Y2)
    cylinder {<X,Y,0>,<X2,Y2,0>,Width}
  #end  
  #local T=T+2*pi/Lines;
 #end
 }  
#end

object {Maurer(2.1,4,120,360,0.005)
   pigment {rgb 0}
   translate -2*x
}

object {Maurer(2.1,6,72,360,0.005)
   pigment {rgb 0}
   translate 2*x
}


Post a reply to this message

From: Patrick Elliott
Subject: Re: Flower power
Date: 23 Oct 2003 17:31:02
Message: <MPG.1a01f4943b4461b8989906@news.povray.org>
In article <KwnOiDA022l$EwP5@econym.demon.co.uk>, 
nos### [at] econymdemoncouk says...
> Wasn't it Patrick Elliott who wrote:
> 
> >In my case I am trying to do something like:
> >
> >N = 5 * rnd
> >vdelta = 2 * PI * rnd
> >vector = a * sin(N * vdelta)
> >X = cos(vector) * 30 
> >Y = sin(vector) * 30
> >
> >The problem is all I get is a dang circle... It is driving me batty. If 
> >it was for something in POV, it would be driving me even more nuts. But 
> >man would the StarrRose make a real nice Isosurface. Sigh...
> 
> I think that N should be a constant (it's the number of petals or half
> the number of petals depending on whether it's odd or even) and X and Y
> should be cos(vdelta)*vector and sin(vdelta)*vector. "a" is a scaling
> factor, the maximum radius of the whole shape
> 
> So:-
> 
> #version 3.5;
> global_settings {assumed_gamma 1.0}
> camera {location  <0,0,-10> look_at <0,0,0> angle 50}
> background {rgb 1}
> light_source {<-30, 100, -30> color rgb 1}
> 
> #declare rnd=0;
> #declare N = 5;
> #declare a=3;
> #while (rnd < 1)
>   #declare vdelta = 2 * pi * rnd;
>   #declare vector = a * sin(N * vdelta);
>   #declare X = cos(vdelta) * vector; 
>   #declare Y = sin(vdelta) * vector;
>     sphere {<X,Y,0>,0.2 pigment {rgb <1,1,0>}}
>   #declare rnd = rnd + 0.001;
> #end
Heh! That works. Was screwed up on the correct way to convert polar to 
rectangular. :p

> 
> If we bung the significant bit "vector = a * sin(N * vdelta)" into an
> isosurface it looks like this "a * sin(N * f_th(x,z,y))", which doesn't
> do anything useful on it's own but suggests something like this:-
> 
> #version 3.5;
> global_settings {assumed_gamma 1.0}
> camera { location  <-1, 1, -6> look_at <0, 0, 0> angle 50}
> background {rgb 1}
> light_source {<-30, 100, -30> color rgb 1}
> #include "functions.inc"
> 
> #declare n = 5;
> #declare a = 2;
> isosurface {
>   function { a * sin(n*f_th(x,z,y)) * f_sphere(x,y,z,a) + 0.1}
>   max_gradient 20
>   contained_by{sphere{0,a}}
>   pigment {rgb .9}
>   finish {phong 0.5 phong_size 10}
> }
> 
Yeah. I wondered about shoe horning a useful Z axis into that. The 
StarrRose uses a, b and c as scales, which I think implies it already 
accounts for z, but lacking the equations to define how those are used... 
:p

Like I said though, my own problem wasn't for use in POV, I just thought 
I would ask about it, since the two things are closely related, at least 
with respect to the basic equations. I am actually designing an ActiveX 
control that generates a 2D firework. The X and Y are used as velocity 
vectors so that all the points starts at a central position and drift 
outward, losing X velocity slightly and gaining Y velocity towards the 
ground with each time is draws. Works nice for stuff I could make work 
right, but I completely missed the obvious fact that with X = cos(Delta) 
* r and Y = sin(Delta) * r, r was actually what I had as 'vector'. 
Sigh... Shows you how much I know about math..

However, I stand by the statement that, as a reference sight for 
equations, the fact that this site seem to be the 'only' one with a 
decent list doesn't mean it is a complete or accurate one. I would love 
to actually know how they got that StarrRose. :(

-- 
void main () {

    call functional_code()
  else
    call crash_windows();
}


Post a reply to this message

From: Patrick Elliott
Subject: Re: Flower power
Date: 23 Oct 2003 17:38:14
Message: <MPG.1a01f6489951439d989907@news.povray.org>
In article <rd7WpEAGW7l$EwZc@econym.demon.co.uk>, 
nos### [at] econymdemoncouk says...
> Wasn't it Patrick Elliott who wrote:
> >
> >In theory:
> >
> >http://mathworld.wolfram.com/StarrRose.html
> >
> >However, since they don't actually provide the equations for it, but 
> >simply assume you know how to derive it from the 2D calcs in:
> 
> They do give the method for producing the Maurer Rose
> http://icl.pku.edu.cn/yujs/MathWorld/math/m/m108.htm
> which can be achieved in POV like this. My guess is that the Starr Rose
> just uses some other stepping algorithm, but I can't guess what. I think
> the 3d effect of the Starr is an optical illusion, and that it's
> actually flat like the Maurer.
> 
> This doesn't seem to be moving in the direction of isosurface flowers.
> 
Yeah. Someone that is a math wiz suggested that may be the case. I think 
if you knew what you where doing you could fudge it though. Use one of 
those calcs that produce:

---\
    \---

for the z axis some how with the current radius from the center defining 
where on that path the point lies. I have no clue how to manage it 
though. However, I would think it would be possible. How well it 
would works is another matter.
  

-- 
void main () {

    call functional_code()
  else
    call crash_windows();
}


Post a reply to this message

From: Mike Williams
Subject: Re: Flower power
Date: 24 Oct 2003 01:04:56
Message: <Dx6cyEAP+Hm$EwGW@econym.demon.co.uk>
Wasn't it Patrick Elliott who wrote:

> I would love to actually know how they got that StarrRose. :(

If you feel strongly enough about it to go out and buy the book that
they got the equation from, then perhaps you could let us know.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Dave Matthews
Subject: Re: Flower power
Date: 24 Oct 2003 09:25:01
Message: <web.3f9927d7a022f3b88062416c0@news.povray.org>
Mike Williams wrote:
>Wasn't it Patrick Elliott who wrote:
>
>> I would love to actually know how they got that StarrRose. :(
>
>If you feel strongly enough about it to go out and buy the book that
>they got the equation from, then perhaps you could let us know.
>
>Mike Williams
>Gentleman of Leisure
>
No need, someone already has the book.

What's going on here is a simple parametric curve, "doctored up" to look 3D.
 But we can do something similar in PovRay.

The radius varies according to a set function:  2 + sin(At)/2, creating an
"opened-up" rose.

The twist is that the angle, rather than simply proceeding counter-clockwise
around the circle, backs up on itself, NewT = t + Sin(Bt)/C, so that we
have the modified parametric equations:

x = r(t)cos(NewT), y = r(t)sin(NewT).

All of the shading is done by connecting the origin to the edge of the
curve, then shrinking and superimposing repeated copies of the image on
itself.

We can get one version of this by letting the vertical (y) component vary
according to r(t).

//Starr Rose For PovRay

#version 3.5;

#global_settings { assumed_gamma 1.0 }

camera {        angle 50
                right x*image_width/image_height
                location <0, 50, 0>
                look_at <0, 0, 0>
        }

light_source { <800, 1200, -500> color rgb <1, 1, 1> }

#macro Starr_Rose(A, B, C, N)

  #local Radius= function(Theta) {2 + sin(A*Theta)/2}
  #local AngleShift = function(Theta) {sin(B*Theta)/C}

  #local Angle = 0;

  #local Cycle = 2*pi;
  union {
  #while (Angle <= Cycle)
       #local X = Radius(Angle)*cos(Angle + AngleShift(Angle));
       #local Z = Radius(Angle)*sin(Angle + AngleShift(Angle));
       #local Y = 2 - Radius(Angle) ;
       cylinder { <0, 0, 0>, <X, Y, Z>, 0.05 }

    #local Angle = Angle + Cycle/N;

  #end
    }
#end



object { Starr_Rose(6, 18, 18, 500) texture { pigment { color rgb <1, 0, 0>
} }
                                    scale 5}

/////////////////End of Code

I'm guessing that one of you with more experience at POVRay can do up a
better version, but this gives the idea.


Post a reply to this message

From: Patrick Elliott
Subject: Re: Flower power
Date: 24 Oct 2003 16:58:18
Message: <MPG.1a033e55a2de90bd989909@news.povray.org>
In article <web.3f9927d7a022f3b88062416c0@news.povray.org>, 
dma### [at] wrmnwestmnscuedu says...
> Mike Williams wrote:
> >Wasn't it Patrick Elliott who wrote:
> >
> >> I would love to actually know how they got that StarrRose. :(
> >
> >If you feel strongly enough about it to go out and buy the book that
> >they got the equation from, then perhaps you could let us know.
> >
> >Mike Williams
> >Gentleman of Leisure
> >
> No need, someone already has the book.
> 
> What's going on here is a simple parametric curve, "doctored up" to look 3D.
>  But we can do something similar in PovRay.
> 
> The radius varies according to a set function:  2 + sin(At)/2, creating an
> "opened-up" rose.
> 
> The twist is that the angle, rather than simply proceeding counter-clockwise
> around the circle, backs up on itself, NewT = t + Sin(Bt)/C, so that we
> have the modified parametric equations:
> 
> x = r(t)cos(NewT), y = r(t)sin(NewT).
> 
> All of the shading is done by connecting the origin to the edge of the
> curve, then shrinking and superimposing repeated copies of the image on
> itself.
> 
> We can get one version of this by letting the vertical (y) component vary
> according to r(t).
> 
> //Starr Rose For PovRay
> 
> #version 3.5;
> 
> #global_settings { assumed_gamma 1.0 }
> 
> camera {        angle 50
>                 right x*image_width/image_height
>                 location <0, 50, 0>
>                 look_at <0, 0, 0>
>         }
> 
> light_source { <800, 1200, -500> color rgb <1, 1, 1> }
> 
> #macro Starr_Rose(A, B, C, N)
> 
>   #local Radius= function(Theta) {2 + sin(A*Theta)/2}
>   #local AngleShift = function(Theta) {sin(B*Theta)/C}
> 
>   #local Angle = 0;
> 
>   #local Cycle = 2*pi;
>   union {
>   #while (Angle <= Cycle)
>        #local X = Radius(Angle)*cos(Angle + AngleShift(Angle));
>        #local Z = Radius(Angle)*sin(Angle + AngleShift(Angle));
>        #local Y = 2 - Radius(Angle) ;
>        cylinder { <0, 0, 0>, <X, Y, Z>, 0.05 }
> 
>     #local Angle = Angle + Cycle/N;
> 
>   #end
>     }
> #end
> 
> 
> 
> object { Starr_Rose(6, 18, 18, 500) texture { pigment { color rgb <1, 0, 0>
> } }
>                                     scale 5}
> 
> /////////////////End of Code
> 
> I'm guessing that one of you with more experience at POVRay can do up a
> better version, but this gives the idea.
> 
Oooh! Nice! Now if someone could find a way to tweak it so it makes the 
petals more petal like. But that is way more than I could have ever 
managed. lol

-- 
void main () {

    call functional_code()
  else
    call crash_windows();
}


Post a reply to this message

From: Christopher James Huff
Subject: Re: Flower power
Date: 24 Oct 2003 18:34:19
Message: <cjameshuff-BB159D.18321124102003@netplex.aussie.org>
In article <3F9804C7.2CC33998@Rapidnet.com>,
 "Anthony D. Baye" <ban### [at] Rapidnetcom> wrote:

>     Does anyone know where I might find a dxf or obj model of, say, a
> lotus?  I don't understand half of the math that was just thrown around
> here, and I can't afford the one patch modeller I've been able to find
> for the Mac.

One? MeshWork is $30 shareware: http://codenautics.com/meshwork/

PatchDance is free: http://www.patchdance.com/

jPatch is free:
http://jpatch.sourceforge.net/?page=platforms

Other modellers (free):
Mondfarilo: http://userpages.itis.com/philip/
Art Of Illusion: http://www.artofillusion.org/

And more...
If you have OS X, you can also run most Linux modellers.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Mike Williams
Subject: Re: Flower power
Date: 24 Oct 2003 23:45:30
Message: <RoQIUCAntem$Ew0Z@econym.demon.co.uk>
Wasn't it Patrick Elliott who wrote:
>Oooh! Nice! Now if someone could find a way to tweak it so it makes the 
>petals more petal like. But that is way more than I could have ever 
>managed. lol

Now we have the formula, we can turn that into a parametric isosurface.
Then we can do things like adding noise to make it less perfectly
symmetrical.

//Starr Rose For PovRay
#version 3.5;

#declare A=6;      // Number of petals
#declare B=3*A;    // Ripple frequency
#declare C=B;      // Ripple strength (inverse)
#declare Approx = true; // true = use Ingo's param.inc approximation
                        // false = use parametric isosurface
#declare Noise = 0.3;   // Amount of noise                        

global_settings {assumed_gamma 1.0}
camera {location  <0,0,-10> look_at <0,0,0> angle 40}
background {rgb 1}
light_source {<-10, 10, -30> color rgb 1}
#include "functions.inc"

#declare Radius = function(Theta) {2 + sin(A*Theta)/2}
#declare AngleShift = function(Theta) {sin(B*Theta)/C}

#declare Fx = function(u,v) {Radius(u) * cos(u + AngleShift(u)) * v}
#declare Fy = function(u,v) {Radius(u) * sin(u + AngleShift(u)) * v}
#declare Fz = function(u,v) {2 - Radius(u) +
f_noise3d(u*10,v*5,0)*Noise}
 
#if (Approx) 
  #include "param.inc"
  #if (Noise = 0)
    #declare U=500;
    #declare V=1;
  #else
    #declare U=200;
    #declare V=20;
  #end
  object {
    Parametric(Fx,Fy,Fz,<0,0>,<2*pi,1>,U,V,"")
    pigment {rgb x}
    finish {phong 0.5 phong_size 10}
  }
#else
  parametric {
    function {Fx(u,v)}
    function {Fy(u,v)}
    function {Fz(u,v)}
      <0,0>,<2*pi,1>
    max_gradient 2
    contained_by{box{<-2.6,-2.6,-0.5><2.6,2.6,0.5>}}
    pigment {rgb x}
    finish {phong 0.5 phong_size 10}
  }
#end


Post a reply to this message

From: Mike Williams
Subject: Re: Flower power
Date: 25 Oct 2003 01:57:01
Message: <93SzzCAtBhm$EwAC@econym.demon.co.uk>
And how about this for a Dahlia?

I've removed the option to use a real parametric isosurface because it
was taking too long to render - it now requires Ingo Janssen's
param.inc.

//Dahlia
#version 3.5;

#declare W=4;           // Winding number
#declare A=9.4;         // Number of petals per wind
#declare B=2*A;         // Ripple frequency
#declare C=B*2;         // Ripple strength (inverse)
#declare Noise = 0.3;   // Amount of noise                        

#declare WW = 2*pi*W;
#declare Q=WW*1.5;

global_settings {assumed_gamma 1.0}
camera {location  <0,0,-10> look_at <0,0,0> angle 40}
background {rgb 1}
light_source {<-10, 10, -30> color rgb 1}
#include "functions.inc"

#declare Radius = function(Theta) {2 + sin(A*(Theta-pi/2))/2}
#declare AngleShift = function(Theta) {sin(B*(Theta-pi/2))/C}

#declare Fx = function(u,v) {Radius(u) * 
        cos(u + AngleShift(u)) * v *(1-u/Q)}
#declare Fy = function(u,v) {Radius(u) * 
        sin(u + AngleShift(u)) * v *(1-u/Q)}
#declare Fz = function(u,v) {2 - Radius(u)
         + f_noise3d(u*10,v*5,0)*Noise - u/WW}
 
#include "param.inc"
#if (Noise = 0)
  #declare U=500*W;
  #declare V=1;
#else
  #declare U=200*W;
  #declare V=20;
#end
object {
  Parametric(Fx,Fy,Fz,<0,0>,<WW,1>,U,V,"")
  pigment {onion
   colour_map {
     [0.5 rgb <1,1,0>]
     [0.8 rgb <1,0,0>]
   }
   scale <2.5,2.5,2>
  }
  finish {phong 0.5 phong_size 10}
}


Post a reply to this message

From: Anthony D  Baye
Subject: Re: Flower power
Date: 25 Oct 2003 11:02:40
Message: <3F9A908E.A34F163A@Rapidnet.com>
Either there's a newer version of Param.inc than the one that I found in
the news group or there's something else going on, because I can't get it
to render.

A.D.B.

Mike Williams wrote:

> And how about this for a Dahlia?
>
> I've removed the option to use a real parametric isosurface because it
> was taking too long to render - it now requires Ingo Janssen's
> param.inc.
>
> //Dahlia
> #version 3.5;
>
> #declare W=4;           // Winding number
> #declare A=9.4;         // Number of petals per wind
> #declare B=2*A;         // Ripple frequency
> #declare C=B*2;         // Ripple strength (inverse)
> #declare Noise = 0.3;   // Amount of noise
>
> #declare WW = 2*pi*W;
> #declare Q=WW*1.5;
>
> global_settings {assumed_gamma 1.0}
> camera {location  <0,0,-10> look_at <0,0,0> angle 40}
> background {rgb 1}
> light_source {<-10, 10, -30> color rgb 1}
> #include "functions.inc"
>
> #declare Radius = function(Theta) {2 + sin(A*(Theta-pi/2))/2}
> #declare AngleShift = function(Theta) {sin(B*(Theta-pi/2))/C}
>
> #declare Fx = function(u,v) {Radius(u) *
>         cos(u + AngleShift(u)) * v *(1-u/Q)}
> #declare Fy = function(u,v) {Radius(u) *
>         sin(u + AngleShift(u)) * v *(1-u/Q)}
> #declare Fz = function(u,v) {2 - Radius(u)
>          + f_noise3d(u*10,v*5,0)*Noise - u/WW}
>
> #include "param.inc"
> #if (Noise = 0)
>   #declare U=500*W;
>   #declare V=1;
> #else
>   #declare U=200*W;
>   #declare V=20;
> #end
> object {
>   Parametric(Fx,Fy,Fz,<0,0>,<WW,1>,U,V,"")
>   pigment {onion
>    colour_map {
>      [0.5 rgb <1,1,0>]
>      [0.8 rgb <1,0,0>]
>    }
>    scale <2.5,2.5,2>
>   }
>   finish {phong 0.5 phong_size 10}
> }


Post a reply to this message

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

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