POV-Ray : Newsgroups : povray.advanced-users : Help creating a parametric surface : Re: Help creating a parametric surface Server Time
16 Apr 2024 08:43:58 EDT (-0400)
  Re: Help creating a parametric surface  
From: Bald Eagle
Date: 15 Mar 2018 20:30:01
Message: <web.5aab0f3d67d1924d5cafe28e0@news.povray.org>
I added a standard light source, used a simpler texture (for speed), and then
added contained_by and max_gradient.

That seems to have made the curve show up  :)




#version 3.7;

global_settings {
 assumed_gamma 1.0
}

#include "colors.inc"
#include "glass.inc"
#include "golds.inc"
#include "metals.inc"
#include "stones.inc"
#include "woods.inc"
#include "shapes.inc"
#include "textures.inc"
//#include "spectral.inc"
#include "rand.inc"
//#include "param.inc"
#include "math.inc"


#declare MaxTrace    = 60;
#declare Radio       = 1;
#declare Photons     = 10000000;
#declare Sunlight    = 0;
#declare SkyEmission = 5;

#declare RoomDesign  = 1;


camera {      // sPlace the camera
  location  <-5.0,0,0.0>    // Camera location
  look_at < 0,0,-0>       // Where camera is pointing
//   angle 60           // Angle of the view

}
//global_settings { ambient_light White }   // Ambient light to
       // "brighten up" darker pictures
light_source {<-40, 5, 0> color White}

/*
#declare Lamp = union {
  light_source {<0,0,6>, SpectralEmission(E_Blackbody(5000)) * 200
  fade_power 2
  fade_distance 5
  photons {reflection on refraction on }
  }

  sphere { 0, 5
    pigment { SpectralEmission(E_Blackbody(5000)) }
    finish {emission 3 ambient 0 diffuse 0}
    no_shadow
    no_radiosity
  }

  translate <0, 50, 100>
}

object {Lamp}
*/

background { color White}

/*
plane {
  <12,-0,5>, -12               // This represents the plane 0x+0y+z=0
  texture { Copper_Metal}      // The texture comes from the
       // file "metals.inc"
   }
*/


// u = horizontal angle

#declare logSpiral_a = 1.73;
#declare logspiral_b = 0.083;
#declare logSpiral_c = -0.638;

#declare logSpiral_x = function(u) {
    logSpiral_a*sin(u)*exp(logspiral_b*u)
   }
#declare logSpiral_y = function(u) {
    -1*logSpiral_a*cos(u)*exp(logspiral_b*u)
   }
#declare logSpiral_z = function(u) {
    logSpiral_c*u
   }

// all correct till here.


// v = vertical angle
#declare section_a = 3;
#declare section_b = 1;
#declare section_xMult = 2;
#declare section_yMult = 1.74;

#declare section_x = function(v) {
       section_xMult * cos(v) * (
         pow(sin(v),section_a) + pow(cos(v),section_b)
        )
     }
#declare section_y = function(v) {
       section_yMult * sin(v) * (
         pow(sin(v),section_a) + pow(cos(v),section_b)
        )
     }



#declare ustart = 0;


object { parametric {

  function {logSpiral_x(u) }
  function {-1*logSpiral_y(u)  + section_x(v) }
  function {-1*section_y(v) + logSpiral_z(u)}
  <0,0>,<4*pi,2*pi>
  contained_by {box {<1,1,1>*-10, <1,1,1>*10}}
  max_gradient 20
  accuracy 0.01
  precompute 20 x,y,z

 }
 scale <0.2,0.2,0.2>
 //texture {Green_Glass}
 texture {pigment {Green*0.5} finish {specular 0.4}}

}


Post a reply to this message

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