POV-Ray : Newsgroups : povray.advanced-users : Help wanted for Loxodrome spiral formula : Re: Help wanted for Loxodrome spiral formula Server Time
28 Sep 2024 18:53:06 EDT (-0400)
  Re: Help wanted for Loxodrome spiral formula  
From: Alain
Date: 13 May 2010 12:02:35
Message: <4bec229b$1@news.povray.org>

> Hello, I need help to achieve a spiral ball, I found this script on google but
> it seems to have errors, can you help me do that sort of curve? Thank you.
> (http://www.gravitation3d.com/roice/povray/loxodrome.pov)
>
>
>

Errors:
There is no line break. Everything after the first comment get ignored.
The code itself is not complete.

#include "colors.inc" //ok
#declare sceneScale = 100; //ok
background { rgb <0,.25,.5> } //ok
global_settings { assumed_gamma 1.5 } // deprecated
camera { location <1.5,1,2>*2.5*sceneScale look_at <0, 0, 0>
sky <0,0,1> // z up
right <-4/3,0,0> // right-handed coordinate system
  }

//
// Macros we need
//
// This maps points from the plane onto a sphere.
// From "Visual Complex Analysis"

#macro planeToSphere( pp )
#local t1 = 1 + vdot( pp, pp );
#local t2 = vdot( pp, pp );
#local ret = <  2*pp.x / t1, 2*pp.y / t1, ( t2 - 1 ) / ( t2 + 1 ) >; 
ret*sceneScale
#end

// This is our setup of doing an exponential spiral.
#macro tempFn( i )
#local windingRate = 20;
#local beta = windingRate*pi*i/180;
#local M = ;
#local M = M * exp( (i-(numSegments/2))/25 );
planeToSphere( M )
#end

#macro loxodrome()
#local numSegments = 350;
#local segradius = .015*sceneScale;
sphere_sweep { cubic_spline numSegments+1,
#local i=0;
#while( i<1,1,1,.8> } finish { specular .4 } no_shadow }
// oups, that's definitively broken
// there seems to a big piece of code missing here
// what must be vetween the "i" and the "<"?
// impossible to tell if that light is part of the object
// generated by the macro
light_source { <0,0,(1-.016)*sceneScale> color White
// The slight offset is so we are never inside
// the loxodrome sphere sweep.
//<0,0,sceneScale> color White
looks_like { sphere { <0,0,0>,0.1*sceneScale pigment { rgbt<1,1,1,.99> } 
finish { ambient 1 specular .5 } } } }

loxodrome()

In the while loop, the condition is not complete and not enlosed in 
paired ()
It's index in never incremented.
The loxodrome() and it's while loop are missing their #end

You are beter to communicate directly with the author. Maybe he can give 
you the correct working code.


Alain


Post a reply to this message

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