POV-Ray : Newsgroups : povray.general : Procedurally generating bicubic patches : Procedurally generating bicubic patches Server Time
3 Aug 2024 10:24:12 EDT (-0400)
  Procedurally generating bicubic patches  
From: Greg M  Johnson
Date: 17 Mar 2004 22:22:23
Message: <405915ef$1@news.povray.org>
My next ambition is to make procedurally-generated bicubic patches.  I'm
trying to figure out exactly what the math is behind the control points,
especially for something as simple as a circle-- a cylinder.

I made a circle of four points in Hamapath with radius 0.5.  I then extruded
it one unit. I think I understand all of the math except the control points.
Does anyone understand the math to get a control point that suggests a
circle?  What's the formula in terms of pi and r?   I'm trying to figure out
what the 0.273 means, also a way to generate it to more significant digits.
I'm guessing it's like pi*r*some_constant_I_cannot_fathom.

Example scene below:


camera{
 location < 0.000, 5.000, -20.000 >
 look_at < 0.000, 0.000, 0.000 >
 angle 40.000
}

background{ rgb <0/255,0/255,0/255> }


light_source{<100,100,-100> rgb 1}
light_source{<0,10,-1000> rgb 1}


global_settings{
 adc_bailout 0.0039
 ambient_light rgb <255/255,255/255,255/255>
 assumed_gamma 2.200
 hf_gray_16 0
 irid_wavelength rgb <68/255,46/255,36/255>
 max_intersections 64
 max_trace_level 10
 number_of_waves 10
 radiosity{
  brightness 3.300
  count 100
  distance_maximum 0.000
  error_bound 0.400
  gray_threshold 0.500
  low_error_factor 0.800
  minimum_reuse 0.0150
  nearest_count 6
  recursion_limit 1
 }
}

//patch_obj_00
union{
 bicubic_patch {
  type 1
  flatness 0
  u_steps 3
  v_steps 3
  <-0.500, 0.000, 2.018> <-0.500, 0.273, 2.018> <-0.273, 0.500, 2.018>
<0.000, 0.500, 2.018>
  <-0.500, 0.000, 1.413> <-0.500, 0.273, 1.413> <-0.273, 0.500, 1.413>
<0.000, 0.500, 1.413>
  <-0.500, 0.000, 0.605> <-0.500, 0.273, 0.605> <-0.273, 0.500, 0.605>
<0.000, 0.500, 0.605>
  <-0.500, 0.000, 0.000> <-0.500, 0.273, 0.000> <-0.273, 0.500, 0.000>
<0.000, 0.500, 0.000>
 }
 bicubic_patch {
  type 1
  flatness 0
  u_steps 3
  v_steps 3
  <0.000, 0.500, 2.018> <0.273, 0.500, 2.018> <0.500, 0.273, 2.018> <0.500,
0.000, 2.018>
  <0.000, 0.500, 1.413> <0.273, 0.500, 1.413> <0.500, 0.273, 1.413> <0.500,
0.000, 1.413>
  <0.000, 0.500, 0.605> <0.273, 0.500, 0.605> <0.500, 0.273, 0.605> <0.500,
0.000, 0.605>
  <0.000, 0.500, 0.000> <0.273, 0.500, 0.000> <0.500, 0.273, 0.000> <0.500,
0.000, 0.000>
 }
 bicubic_patch {
  type 1
  flatness 0
  u_steps 3
  v_steps 3
  <0.500, 0.000, 2.018> <0.500, -0.273, 2.018> <0.273, -0.500, 2.018>
<0.000, -0.500, 2.018>
  <0.500, 0.000, 1.413> <0.500, -0.273, 1.413> <0.273, -0.500, 1.413>
<0.000, -0.500, 1.413>
  <0.500, 0.000, 0.605> <0.500, -0.273, 0.605> <0.273, -0.500, 0.605>
<0.000, -0.500, 0.605>
  <0.500, 0.000, 0.000> <0.500, -0.273, 0.000> <0.273, -0.500, 0.000>
<0.000, -0.500, 0.000>
 }
 bicubic_patch {
  type 1
  flatness 0
  u_steps 3
  v_steps 3
  <0.000, -0.500, 2.018> <-0.273, -0.500, 2.018> <-0.500, -0.273, 2.018>
<-0.500, 0.000, 2.018>
  <0.000, -0.500, 1.413> <-0.273, -0.500, 1.413> <-0.500, -0.273, 1.413>
<-0.500, 0.000, 1.413>
  <0.000, -0.500, 0.605> <-0.273, -0.500, 0.605> <-0.500, -0.273, 0.605>
<-0.500, 0.000, 0.605>
  <0.000, -0.500, 0.000> <-0.273, -0.500, 0.000> <-0.500, -0.273, 0.000>
<-0.500, 0.000, 0.000>
 }
 pigment{rgb <235/255, 44/255, 169/255>}
 finish{phong 1}

}


Post a reply to this message

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