POV-Ray : Newsgroups : povray.animations : Rotate object : Re: Rotate object Server Time
18 Jun 2024 08:32:09 EDT (-0400)
  Re: Rotate object  
From: Alain
Date: 10 Jan 2005 05:54:47
Message: <41e25ef7$1@news.povray.org>
Oleguer Vilella wrote:
> Hi all,
> 
> I'm traying to rotate this code on this way:
> ======================================
> #declare MKK1_MKK2 = union {
> union {
> superellipsoid {
> <0.4444, 0.66666667>
> pigment { color Brown } finish { ambient 0.2 diffuse 0.8 }
> scale <0.5, 0.56, 0.6>
> scale 5.5
> rotate x*-80
> rotate y*60
> translate <162.9, -46.3, 0> }
> sphere { <0, -1, -1>, 0.4 pigment { color Brown} finish { ambient 0.2 
> diffuse 0.8 phong 1 } translate <0, 2, 0.5> scale <0.6667,1,1> }
> sphere { <0, -1, -1>, 0.4 pigment { color Brown} finish { ambient 0.2 
> diffuse 0.8 phong 1 } translate <0.8, 2, 0.5> scale <0.6667,1,1> }
> no_shadow
> }
> 
> union {
> superellipsoid {
> <0.4444, 0.66666667>
> pigment { color Brown } finish { ambient 0.2 diffuse 0.8 }
> scale <0.5, 0.56, 0.6>
> scale 5.5
> rotate x*-80
> rotate y*60
> translate <175.9, -44.8, 0>
> }
> sphere { <0, -1, -1>, 0.4 pigment { color Brown } finish { ambient 0.2 
> diffuse 0.8 phong 1 } translate <0, 2, 0.5> scale <0.6667,1,1> }
> sphere { <0, -1, -1>, 0.4 pigment { color Brown } finish { ambient 0.2 
> diffuse 0.8 phong 1 } translate <0.8, 2, 0.5> scale <0.6667,1,1> }
> no_shadow
> }}
> 
> #declare xvibrate_2=cos(clock*2*pi*(20/20)*1.5)*pow(2.817, 
> clock*(20/20)*1.5);
> 
> object { MKK1_MKK2 translate <0, 0, 0> translate <-xvibrate_2, 0, 0> }
> ======================================
> A part of this movement I want to rotate both of them like a ball. Maybe 
> something like this?:
> ======================================
> rotate <0, 0, -clock*360>
> ======================================
> 
> All helps will be welcome.
> 
> Best regards,
> Oleguer 
> 
> 
Just add that rotation to your unions. Or combine the two unions and 
rotate the big union as a whole.

Alain


Post a reply to this message

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