POV-Ray : Newsgroups : povray.binaries.images : Gosper Island - for ADB : Re: Gosper Island - for ADB Server Time
7 Nov 2024 09:29:25 EST (-0500)
  Re: Gosper Island - for ADB  
From: Anthony D  Baye
Date: 14 Mar 2016 19:15:01
Message: <web.56e7452beb686e80fd6b6fe10@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> Apologies again about the hastily and erroneously drawn sketch.
>
> Here's an update for anyone playing along at home.   :)

And my update...

Thanks to Scott and Bald Eagle for their help un-derping my math.

Regards,
A.D.B.
#version 3.7;

global_settings { assumed_gamma 1.8 }

#include "colors.inc"
#include "math.inc"

#declare ft =12.0 ;

light_source { <0.0, 0.0, -1.0*ft> rgb 1 }

camera {
 perspective
 location <0.0, 0.0, -10.0>
 up y
 right x*(image_width/image_height)
 look_at <0.0, 0.0, 0.0>
 }

#default {
    pigment { Orange }
    finish { ambient 0 diffuse 0.7 }
    }

#macro vec2rot(V, A)
    #local _X_ = V.u*cos(A) - V.v*sin(A);
    #local _Y_ = V.u*sin(A) + V.y*cos(A);
    #local RESULT = <_X_,_Y_>;
    RESULT
#end

#macro gosper_axiom(p0, p1)

#local V = p1 - p0;
#local len = vlength(V);

    #if( len > 0.01 )
        #local THETA = asin(sqrt(3)/(2*sqrt(7)));
        #local vT = vnormalize(V);
        #local newlen = len/sqrt(7);
        #local newvec = vec2rot( vT,THETA);
        #local np1 = p0 + newlen*vec2rot( vT,THETA);
        #local np2 = p1 - newlen*vec2rot( vT,THETA);

        gosper_axiom(p0,np1)
        gosper_axiom(np1,np2)
        gosper_axiom(np2,p1)

    #else
        cylinder { p0, p1 0.0078125 }
    #end
#end

#macro GosperIsland(R)
    #for(A,0,300,60)
        cylinder { R*<cosd(A), sind(A)> R*<cosd(A+60), sind(A+60)> 0.0078125
            pigment { Red } finish { ambient 0 diffuse 0.7 } }
        gosper_axiom( R*<cosd(A), sind(A)>, R*<cosd(A+60), sind(A+60)>)
    #end
#end

#for(A,0,300,60)
    union { GosperIsland(1.0) rotate (A)*z translate 2*sind(60)*<sind(A),
cosd(A), 0.0> }
#end


Post a reply to this message


Attachments:
Download 'vectorlab.png' (42 KB)

Preview of image 'vectorlab.png'
vectorlab.png


 

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