PDA

View Full Version : Poor man's animation


PerFnurt
24th February 2005, 05:47 PM
Here's an example of how one can do rudimentary animations, like moving objects about etc. using only AC3D and POVRay.
Alas, I have no knowledge of suitable (=easy to use and cheap) tools that'd be better for this kind'o stuff. Please let me know if you know any.


The idea is to get coordinates from AC3D to move objects about in the animation (in this example just the camera).

Example:
Create a disk and remove it's center vertex. Twiddle its vertexes about.
Something like this (the object in the middle is just an ugly sword):
http://www.perfnurt.se/img/poor_anim1.gif

Save the file and open it in a texteditor (1).
Copy the coordinates.

OBJECT poly
name "disk"
loc -2.8753 9.9027 2.00898
crease 45.000000
numvert 64
9.31985 0 -1.04631-----+
9.16563 0 -1.45228 |
8.91025 0 -1.85038 |
. |
. |--- Copy
. |
9.31985 0 -0.226486 |
9.37142 0 -0.636399----+


Paste the text into a new file and
replace space with comma.
Replace start of line with "<" (no quotes) and end of line with ">," (no quotes). Easily done if the editor supports regular expressions (^ is start of line, $ is end of line)

Define an array in POVRay and paste the coord to it (and remove the last comma).


#local cameraPositions = array[64]
{
<9.31985,0,-1.04631>,
<9.16563,0,-1.45228>,
<8.91025,0,-1.85038>,
.
.
.
<9.31985,0,-0.226486>,
<9.37142,0,-0.636399>

}



Now it's easy let an object move along the path of the coordinates


#local cameraPosIndex = clock; // clock = [0.0 .. 63.0]

camera
{
location cameraPositions[cameraPosIndex]
up < 0.000000, 1.000000, 0.000000>
look_at < 0,0,0 >
}


Of course you can use other things than a disk: lines, revolved vertices and whatnot, but you get the idea.

I do have a feeling this is a VerySilly(tm) approach, but I thought I'd share it anyway as it works for me.

(1) This is because AC3D, as far as I can tell, won't spit out the coords when it generates the .pov since there's no surface.

PerFnurt
30th March 2005, 03:44 AM
If you use the PfPOV plug-in ( http://www.perfnurt.se/pfpov.asp ) you don't have to get the coords from the .ac file and do all the find-replace crazyness.

PfPOV will generate an array for objects that is nothing but a bunch of vertices.