POV-Ray : Newsgroups : povray.general : Procedurally generating bicubic patches : Re: Procedurally generating bicubic patches Server Time
3 Aug 2024 10:16:19 EDT (-0400)
  Re: Procedurally generating bicubic patches  
From: Chambers
Date: 18 Mar 2004 15:37:34
Message: <405a088e$1@news.povray.org>
"Greg M. Johnson" <gregj;-)565### [at] aolcom> wrote in message
news: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.

<disclaimer> Well, you can't exactly model a sphere / cylinder, sine waves,
or anything like that with a bezier patch because it's a cubic function
</disclaimer>

That being said, you *can* get awfully close :)

In terms of how they work, it helps to work with a 2d spline first.  Say you
have two points, A and D, and two control points B and C (between A and D).
The spline will start at A, pointed at B.  It will end at D, as if it were
coming from C.  Or, in other words, the slope at point A is the vector from
A to B, and the slope at D is the vector from C to D.  The spline more or
less smoothly "blends" between the two :)

Working in 3D, it's similar.  Say we have 16 control points p(0..3, 0..3).
The normal at p(00) is perpendicular to the plane formed by p(00), p(01) and
p(10).  The other three corners are also found by finding the planes formed
by the two adjacent control points and the corner.  Understanding this, it's
pretty easy to hand craft patches that roughly give the shape you want
(though visual modellers help), and trivial to generate patches that
seamlessly fit together via a script.

-- 
...Chambers
http://www.geocities.com/bdchambers79


Post a reply to this message

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