|
![](/i/fill.gif) |
"Anthony D. Baye" <Sha### [at] hotmail com> wrote in message
news:437f641e$1@news.povray.org...
> Can anybody suggest a method by which a partially unrolled scroll might
> be created Parametrically? I've been trying to create a CSG scroll, but
> I'm about at my wits' end with the Trig functions.
>
> If anybody can help with this, it would be greatly appreciated.
>
> Regards,
>
> A.D.B
Here's an alternative one:
It uses a different mesh generator (array2mesh2.inc attached) and is less
parameterised than Mike's. It also rolls the bottom up in the opposite
direction.
camera {location <-0.2,0.3,-0.5> look_at 0.1}
light_source { <-10,4,-4> color rgb 1}
light_source { <-10,-7,-40> color rgb 1}
#include "math.inc"
#include "array2mesh2.inc"
#local ScrollArray = array [1000][2];
#local I = 0;
#local ArrayIndex = 0;
#local R = 0.015;
#while (I<900)
#local X = R*cosd(I);
#local Y = R*sind(I);
#local Z = 0;
#local ScrollArray[ArrayIndex][0] = <X+0.15,Y+0.3,Z-0.15>;
#local ScrollArray[ArrayIndex][1] = <X+0.15,Y+0.3,Z+0.15>;
#local R = R*1.01; // Add 1 percent to the radius each time
#local I = I + 10;
#local ArrayIndex = ArrayIndex + 1;
#end
#local ScrollArray[ArrayIndex][0] = <X+0.135,Y+0.25,Z-0.15>;
#local ScrollArray[ArrayIndex][1] = <X+0.135,Y+0.25,Z+0.15>;
#local ArrayIndex = ArrayIndex + 1;
#local ScrollArray[ArrayIndex][0] = <X+0.115,Y+0.2,Z-0.15>;
#local ScrollArray[ArrayIndex][1] = <X+0.115,Y+0.2,Z+0.15>;
#local ArrayIndex = ArrayIndex + 1;
#local ScrollArray[ArrayIndex][0] = <X+0.065,Y+0.1,Z-0.15>;
#local ScrollArray[ArrayIndex][1] = <X+0.065,Y+0.1,Z+0.15>;
#local ArrayIndex = ArrayIndex + 1;
#local ScrollArray[ArrayIndex][0] = <X+0.035,Y+0.05,Z-0.15>;
#local ScrollArray[ArrayIndex][1] = <X+0.035,Y+0.05,Z+0.15>;
#local ArrayIndex = ArrayIndex + 1;
#local I = I-40;
#while (I<1800)
#local X = R*cosd(I);
#local Y = R*sind(I);
#local Z = 0;
#local ScrollArray[ArrayIndex][0] = <X,Y,Z-0.15>;
#local ScrollArray[ArrayIndex][1] = <X,Y,Z+0.15>;
#local R = R*0.99; // Add 1 percent to the radius each time
#local I = I + 10;
#local ArrayIndex = ArrayIndex + 1;
#end
#local DummyArray = array [ArrayIndex][2];
#local ppVerbose = 0;
object {ppMesh2FromArray(ScrollArray, DummyArray, ArrayIndex, 2, 0) pigment
{color rgb <1,1,0.9>} }
Post a reply to this message
Attachments:
Download 'array2mesh2.inc.txt' (7 KB)
|
![](/i/fill.gif) |