|
|
On Tue, 09 Feb 1999 18:58:11 -0800, Mark Palmquist
<mpa### [at] earthlinknet> wrote:
>Trying to use POV to generate columns with x number grooves, forget my
>math (to many years ago.....). this is the code I used but not working,
>
>can someone enlighten me please. I know it has something to do with the
>
>sin/cos stuff but can't figure it out with the remaining 3 brain cells
>in my skull.
>
<code>
As I see it, you are using degrees instead of radians. POV's trig
funcitons take radians as parameters. I think this should work.
// ----------------------------------------
#declare grooves = 36
#declare vector = 2*pi/grooves
#declare Angle=0;
#declare groove_radius=0.1
#declare groove_center=1.05
difference
{
cylinder{ <0,0,0>, <0,3,0>, 1 pigment {Red} }
#while (Angle < 2*pi )
cylinder
{
<groove_ center*cos(Angle),-1, groove_center* sin(Angle))>,
<groove_ center*cos(Angle),4, groove_center* sin(Angle))>,
groove_radius
pigment {Blue}
}
#declare Angle=Angle+vector;
#end
}
//-----------------
Should work except for a typo or two (or three). Didn't test it
though.
Peter
Post a reply to this message
|
|