POV-Ray : Newsgroups : povray.general : Flower power : Re: Flower power Server Time
4 Aug 2024 02:20:55 EDT (-0400)
  Re: Flower power  
From: Mike Williams
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

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