prev index next |
Making
Difficult Objects
|
POV-Ray Tips,
Tricks, and Techniques |
Spiral /
Spring Generator?
|
Karl Manning wonders: | Is there a spiral generator/include file for POV somewhere?
Specifically I want to generate some spring like objects. |
|
Guy Rauscher posts a solution:
|
Try this bit of code:
// SPRING.POV
#include "colors.inc"
#default {
camera { location <0,5,-5>
light_source { <5,20,-20> color White*1.5 } #declare spring = union {
object { spring }
I didn't use Povray for a while because I was busy studying, but I'm
pretty sure this works. It will create a spring of a major radius of R1
(distance from y axis to the extend of the spring) and a minor radius of
R2 (the actual radius of the spring). The spring will start at <0,0,0>
and will go up to <0,H,0>, cycling N times around the y axis.
If it seems a little bulky (unlikely, but it is made of cylinders), decrease
T, which controls the distance at which another cylinder is made reaching
the previous cylinder. The connections between the cylinders are connected
by spheres. For more examples of this technique, see my entry to the Flight
IRTC: foo.jpg. Please comment.
|
|