POV-Ray : Newsgroups : povray.newusers : Rotating triangle around middle point : Re: Rotating triangle around middle point Server Time
30 Jun 2024 03:34:00 EDT (-0400)
  Re: Rotating triangle around middle point  
From: RayZ
Date: 11 Sep 2011 20:55:00
Message: <web.4e6d5808dbede6f8eee66afe0@news.povray.org>
Alain <aze### [at] qwertyorg> wrote:
>
> You correctly move your triangle around the origin, transform it, then
> translate it back in it's desired location. Good.
>
> Your "scale -1*clock" (same as scale<-1,-1,-1>*clock) is an isotope
> scaling. What you seems to want is a rotation of your triangle going
> from 0 to 180 degree over the course of your animation.
> It may also be that you want your triangle to shrink down to almost
> nothing, then grow back as a reversed image of it's original shape.
>
> First case, use rotate [axis]*clock*180
>
> Second case, you need to adjust your scaling range. Sample:
> scale 1-clock*2
> This gives an effective range going from <1,1,1> to <-1,-1,-1>.
>
> This will make your object start at it's full size, shrink down, then
> expand back to it's original size but with it's dimensions inverted.
> In this case, you MUST ensure that clock NEVER reach exactly 0.5. This
> will cause a scaling by zero which is undefined and will default to
> scale 1 with a warning been issued.
>
>
>
> Alain

Ok, I'll use
rotate [axis]*clock*180
, but I don't know how to find the axis.
from the three points I made a 4th one which was the center of the 3, which the
triangle is supposed to rotate on

#declare a = <1,1,0>;
#declare b = <1,0,-1>;
#declare c = <0,1,-1>;
#declare d = <2/3,2/3,-2/3>;

but I don't know how to rotate it around and keep the 2 triangles coplanar.

OK I'll stop "lying". I actually want to make an animation where an icosahedron
has triangles which grow to a specified size, and rotate (on axis) 180 degrees
during the growth.
here is an example

#declare B  = <0,1,-1.618>;
#declare E  = <1,1.618,0>;
#declare J  = <1.618,0,-1>;

union{
triangle{ B, E, J pigment{ rgbf<1,0,0,0>}    //colour and points
translate -B/3 translate -E/3 translate -J/3 //translate to origin
scale (14 + 6 * sqrt(5)) / 4 * clock         //specified resize
rotate <0,0,0>                               //the part where it rotates 180 on
the axis, need help on this
translate B/3 translate E/3 translate J/3    //translate back
finish{ambient 0.5}                          //brighter :P
}

so if you can please clarify the axis part, thanks.


Post a reply to this message

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