|
|
> 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
|
|
|
|
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
|
|