POV-Ray : Newsgroups : povray.newusers : Rotations out the origin Server Time
25 Nov 2024 11:55:58 EST (-0500)
  Rotations out the origin (Message 1 to 3 of 3)  
From: vianagmo
Subject: Rotations out the origin
Date: 11 Jan 2006 12:05:01
Message: <web.43c5399f8c3624943c328cf0@news.povray.org>
Hi,

I have made an object with two intersections: First, two planes and a sphere
in the origin. Second, this new portion and other two planes. Now I want to
translate and rotate this new object, but the result isn`t the expected. I
have tried rotation and translation and inverse but it doesn't work. Maybe
anyone can explain to me how rotation and translation work when are aplied
over a portion of an object which is the result of intersections.

The code is something like this:

#declare Portion =
intersection
{
  plane
  {
    <0, 0, 1>
    0
  }
  plane
  {
    <0, 0, -1>
    0
    rotate <0, -89.9543768408, 0>
  }
  intersection
  {
    plane
    {
      <0, -1, 0>
      71.7356099205
    }
    plane
    {
      <0, 1, 0>
      71.7356099205
    }
    sphere
    {
      <0, 0, 0>, 100.0
    }
  }
  texture
  {
    pigment
    {
      color <0.0, 0.0, 1.0>
    }
  }
}

object
{
  Portion
  translate <0.0, 300.0, 0.0>
  rotate <89.9999820139, -0.0, -0.0>
}


Post a reply to this message

From: Trevor G Quayle
Subject: Re: Rotations out the origin
Date: 11 Jan 2006 12:55:00
Message: <web.43c545cd1e81bb8a6c4803960@news.povray.org>
> object
> {
>   Portion
>   translate <0.0, 300.0, 0.0>
>   rotate <89.9999820139, -0.0, -0.0>
> }


Rotations are made about the origin <0,0,0> no matter where the object is
located.  So translating then rotating does not equal rotating then
translating.

you probably want:

rotate <89.9999820139, -0.0, -0.0>
translate <0.0, 300.0, 0.0>


-tgq


Post a reply to this message

From: Mike the Elder
Subject: Re: Rotations out the origin
Date: 11 Jan 2006 14:10:00
Message: <web.43c5575a1e81bb8a5a8888d90@news.povray.org>
A (hopefully) helpful hint:

It's usually a good idea to design an object so that the
point around which it will most often rotate, usually the
center of gravity, is the origin.

This box: #declare EZRotBox = box{<-3,-2,-1>,<3,2,1>}
will rotate about its center as one would usually expect.

Whereas,
This box: #declare HardRotBox = box{<0,0,0>,<6,4,2>}
is the same size and shape as the one above, but will
rotate about its lower left front corner, which is
USUALLY not what one would want.

-Mike


Post a reply to this message

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