POV-Ray : Newsgroups : povray.binaries.scene-files : Stupid math problem, HELP!!!!! : Re: Stupid math problem, HELP!!!!! Server Time
29 Apr 2024 05:41:20 EDT (-0400)
  Re: Stupid math problem, HELP!!!!!  
From: Peter Popov
Date: 9 Feb 1999 23:27:31
Message: <36c108d5.864491@news.povray.org>
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

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