POV-Ray : Newsgroups : povray.binaries.images : who needs lightflow... : Re: who needs lightflow... Server Time
18 Aug 2024 12:18:47 EDT (-0400)
  Re: who needs lightflow...  
From: JRG
Date: 28 Apr 2001 12:54:37
Message: <3aeaf5cd$1@news.povray.org>
>   Perhaps someone else wants to to think about this?
>
I don't know if this can be usefull, but this is the original lightflow code
(b-spline):


p = vector3array()

N = 50
M = 10
R = 1.0
r = 0.2

#alloc arrays
p.setSize( N * M )

for i in range( 0, N ) :
    u = 2.0 * pi * i / N

    for j in range( 0, M ) :
 v = 2.0 * pi * j / M

        index = i + j*N

 p.set( index, vector3( cos(u) * (R + cos(v)*r * (1.0 + cos(u*8.0)*0.8)),
          sin(u) * (R + cos(v)*r * (1.0 + cos(u*8.0)*0.8)),
          sin(v)*r * (1.0 + cos(u*8.0)*0.8) + r*(1.8) ) )

    if not (i % 10) :
        sys.stdout.write("\rallocating vertices %d %%" % ((i * 100) / N) )
        sys.stdout.flush()

print

s.addObject( s.newObject( "bspline",
     [ "size", N, M,
       "wrap", 1, 1,
       "step", BSplineStep(), BSplineStep(),
       "basis", BSplineBasis(), BSplineBasis(),
       "points", p,
       "tolerance", 0.02, 0.1, 0.05 ] ) )

# destroy arrays
del p


Post a reply to this message

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