POV-Ray : Newsgroups : povray.newusers : rotate object does not seem to work : Re: rotate object does not seem to work Server Time
29 Jul 2024 12:19:14 EDT (-0400)
  Re: rotate object does not seem to work  
From: Edee
Date: 19 Nov 2005 21:35:01
Message: <web.437fe0aaa413c3ef8bbafa7b0@news.povray.org>
Mike Williams <nos### [at] econymdemoncouk> wrote:
> Wasn't it Edee who wrote:
> >In the snippet below, the object rotate does not rotate when a variable
> >value but works with a fixed value.  It appears to be always set to zero
> >(no rotaion0 when a variable is used.  The goal was to create a spiral
> >series of I-beams.  Can anyone help me with what I am doing wrong?
> >thanks
> > ...
> >        rotate <0,90,0>
>
> You're rotating each beam by the same amount. To rotate each beam
> differently you need to use something like this
>
>         rotate <0,90-i*rrate*180/pi,0>
>
> Note that "rotate" uses degrees, but rrate is in radians, hence the
> *180/pi.
>
> --
> Mike Williams
> Gentleman of Leisure


My confusion arose out of the radians for trig functions, and rotations
being in degrees and needed a negative value to have the radial effect
desired of a spiral stair case.  The snippet also did not include the
variable being used.  I also plan to use upper case variable name for final
version.
The version that seems to work for me follows, thank you all for your help.

      #declare i = 0;
      #declare h = 0;     //elevation
      #declare R = 5;     //outer radius
      #declare a = 0;
      #declare da = 360/40;
      #declare bpi = 40;  //beams per pi
      #declare rrate = 5*2*pi/360; //ramprate
      #declare bspan = 2*pi*R/40;
      #declare dh = bspan*tan(rrate);
      #while (i<40)
        object { I_beam
        texture { Steel_Beam }
        rotate -a*y
        translate <R*cos(a*pi/180), h, R*sin(a*pi/180) >
        //translate y*h
         }
        #local a = a + da;
        #local i = i + 1;
        #local h = h + dh;

      #end


Post a reply to this message

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