[fluxus] sphere triangles

Alex x37v.alex at gmail.com
Mon Feb 20 21:55:17 PST 2006


I've been doing deformations of the sphere and one thing that i've
found that is annoying is that (i'm pretty sure) there is an arc on
the sphere where vertices of the triangles don't match up [i assume
the first and last triangles computed at each level in y].

My explanation isn't very good, so see this example:

(define ob (build-sphere 10 10))
(grab ob)
(define deform
  (let ((pt 0)
        (myhash (make-vector (inexact->exact (pdata-size))))
        )
    (lambda (n)
      (set! pt (hash-ref myhash (pdata-get "p" n)))
      (if (not pt)
        (begin
          (set! pt (vmul (pdata-get "p" n) (+ 0.7 (* (flxrnd) 0.3))))
          (hash-set! myhash (pdata-get "p" n) pt)
          )
        )
      (pdata-set "p" n pt)
      (if (> n 0)
        (deform (1- n))
        )
      )
    )
  )

(deform (pdata-size))
(ungrab)

You can see that the sphere is no longer "solid".  I figure this could
probably be fixed by doing a check when computing the sphere, storing
the first vertices computed and comparing them to the last ones [if i
am correct], then setting the two to be equal.  while i could do this
myself it would take me a while to figure out what exactly is
happening, it seems like it would be a really quick fix for someone
who knows the code really well.

-Alex



More information about the Fluxus mailing list