POV-Ray : Newsgroups : povray.newusers : rotative illumination : Re: rotative illumination Server Time
29 Jul 2024 04:21:27 EDT (-0400)
  Re: rotative illumination  
From: Tim Attwood
Date: 25 Sep 2006 20:18:36
Message: <451871dc$1@news.povray.org>
The default coordinates in POV are left-handed.
If you hold your left hand with your thumb up,
your index finger pointed away, and your middle
finger bent across your body then those fingers and
thumb represent the positive directions of the
X,Y, and Z axes.

X (middle finger: right positive, left negative)
Y (thumb: up positive, down negative)
Z (index finger: forward positive, rearward negative)

Rotations also use this same memory-tool,
if you hold your left hand representing the axes, then
trace upwards from the inside of your palm with your
right pointer, rotating first around your middle, then
index, and then thumb, you are rotating in the
positive direction for the axes.

rotate X (an object on top of the x axis will rotate away)
rotate Z (an object on top of the z axis will tilt left)
rotate Y (an object on the origin will spin clockwise)

Normally, objects are created centered on the origin,
then rotated to the angle required, and then translated
to the desired location.

Simple orbits can be made by first translating an object
to it's desired location in relation to its orbit-center, and
then rotating the object around the origin, after the
desired orbital rotations are done, then translate the
object again, moving its orbit-center to the desired final
location.

Elliptical orbits can't be done with scale, except with
point_lights, because the scaling will effect the object
shape.  Instead, you do the same process with math.
POV has many built in vector functions for this.
Usually a vector will have 3 terms, representing a
point. <X,Y,Z> So if you want to calculate an elliptical
orbit, you start with a point on a circular orbit, rotate it,
scale it, then rotate the elliptical orbit about its orbit-center,
and then translate your object from where you created it
(preferably the origin) to the final position using the
point you calculated for the placement.

So for example:
#declare orbit = <10000,0,0>; //major radius
#declare orbit = vrotate(orbit,<0,360*clock,0>); // rotate about origin
#declare orbit = orbit*<1,1,0.5>; // scale z for minor radius
#declare orbit = vrotate(orbit,<-60,0,0>); // tilt orbit up
#declare orbit = vrotate(orbit,<0,30,0>); // twist orbit a bit
object { spoon translate orbit } // put it there

POV also has splines, which can be used to create custom
paths, which can be used to move objects in animations, or
to move cameras smoothly.


Post a reply to this message

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