[fluxus] sphere triangles

dave dave at pawfal.org
Thu Feb 23 08:13:41 PST 2006


fwiw - the way I usually get round this is to only move verts along the
direction of their normals - as the sphere is smoothed, the normals of
coincident verts will be the same, so you can deform away and the
triangles will match up.

see the deform function in 09-toon2.scm for an example

On Thu, 2006-02-23 at 01:23 +0000, dave wrote:
> this is very akward isn't it. I think we possibly need indexed polyprims
> after all. I think what's going on in this case is that there is a
> rounding error causing the edge points to be not quite equal, throwing
> your hashing
>  off. try adding a small tolerance in your key matching?
> 
> the nurbs primitive would be easer for this sort of thing, but
> ironically you'd still get the tearing along the seams.
> 
> On Mon, 2006-02-20 at 21:55 -0800, Alex wrote:
> > 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
> > _______________________________________________
> > fluxus mailing list
> > fluxus at lists.pawfal.org
> > http://lists.pawfal.org/listinfo.cgi/fluxus-pawfal.org
> 
> _______________________________________________
> fluxus mailing list
> fluxus at lists.pawfal.org
> http://lists.pawfal.org/listinfo.cgi/fluxus-pawfal.org




More information about the Fluxus mailing list