POV-Ray : Newsgroups : povray.text.tutorials : Rotate around central axis : Re: Rotate around central axis Server Time
26 Apr 2024 08:11:06 EDT (-0400)
  Re: Rotate around central axis  
From: Tom Melly
Date: 20 Dec 2000 10:57:04
Message: <3a40d6d0$1@news.povray.org>
"Philippe-H Cadet" <del### [at] videotronca> wrote in message
news:3a3f0841$1@news.povray.org...

Hi Philippe,

As you may have gathered (or not), you have one or two very common
misconceptions to abandon.

Warp's info is the most accurate, but possibly not the most comprehensible
to a novice.

The best way, IMHO, to avoid muddles is to always create objects with a
point that rests at <0,0,0>. It doesn't matter which point (e.g. the center
of a sphere or its base), just as long as you know which point.

Secondly, always scale, then rotate and finally translate (there are many
exceptions to this, but you will generally recognise them as exceptions).

I call this my door rule: 1st you scale your hand to the door-knob, then you
rotate the knob, finally you push or pull (translate) the door.

To see why, try this scene where scale and translate are swapped on
otherwise similiar spheres:

//  start scene
camera{location <0,0,-50> look_at 0}
light_source{<0,0,0> color rgb 1 translate <10, 10, -30>}

sphere{<0,1,0>, 1 scale 10 translate <5,0,0> pigment{rgb<1,0,0>}} // base of
sphere at x = 0, so when scaled it stayed at 0 as 10*0 is still 0
sphere{<0,1,0>, 1 translate <-5,0,0> scale 10 pigment{rgb<0,1,0>}} // base
of the sphere was at x = -5, so when scaled it moved to x=-50 (10*-5)

// end scene

The point to note is that scaling and rotation take place relative to
<0,0,0>. Translation takes place relative to the object. The object itself
has no defined center, nor any special relationship to <0,0,0>. Also, as
Warp said, translation means move all points of the object by this amount,
not to a particular co-ordinate. Therefore "translate <0,0,0>" means "do not
move the object", not "move it to <0,0,0>".

Hope this helps.


Post a reply to this message

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