POV-Ray : Newsgroups : povray.advanced-users : Help wanted for Loxodrome spiral formula Server Time
23 Dec 2024 11:43:30 EST (-0500)
  Help wanted for Loxodrome spiral formula (Message 1 to 5 of 5)  
From: Lightbeam
Subject: Help wanted for Loxodrome spiral formula
Date: 12 May 2010 04:45:01
Message: <web.4bea6a248535e886378ca6270@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)


Post a reply to this message

From: Alain
Subject: Re: Help wanted for Loxodrome spiral formula
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

From: Lightbeam
Subject: Re: Help wanted for Loxodrome spiral formula
Date: 13 May 2010 13:20:01
Message: <web.4bec33fadc6728081f6dcce70@news.povray.org>
Thank you Alain.
I'll try this soon :-)


Post a reply to this message

From: Le Forgeron
Subject: Re: Help wanted for Loxodrome spiral formula
Date: 14 May 2010 03:50:04
Message: <4bed00ac$1@news.povray.org>
Lightbeam a écrit :
> 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)
> 
> 
> 
The script did render fine (on my linux/povray 3.7beta, may be you have
issue with LF vs CR+LF ?)
Rendered image seems coherent with

http://mathworld.wolfram.com/SphericalSpiral.html

(at least, it looks very similar)

What kind of errors do you have ?
Do you want to see the image in p.b.i ?

-- 
Real software engineers work from 9 to 5, because that is
the way the job is described in the formal spec.  Working
late would feel like using an undocumented external procedure.


Post a reply to this message

From: paola
Subject: Re: Help wanted for Loxodrome spiral formula
Date: 20 Jan 2013 05:50:01
Message: <web.50fbcbc0dc672808b5e07a870@news.povray.org>
"Lightbeam" <nomail@nomail> wrote:
> Thank you Alain.
> I'll try this soon :-)

hello,
were you able to make the loxodrome spiral? I'm kind of interested too :-)


Post a reply to this message

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