[Fluxus] commits

Glauber Alex Dias Prado smade4 at gmail.com
Tue Nov 18 06:43:00 PST 2008


"Dave Griffiths" <dave at pawfal.org> writes:

Nice stuff, i would like to ask a minor thing:
> Hi all,
>
> A few more commits, motivated by some stuff I'm working on:
>
> * It's possible to reparent objects in the scene hierachy. Previously
> (parent) only had effect on the state stack, and couldn't be changed after
> a primitive had been created. Now you can do something like this:
>
> ; make a cube
> (define a (with-state
>     (translate (vector -3 0 0))
>     (build-cube))
>
> ; make another cube
> (define b (with-state
>     (translate (vector 3 0 0))
>     (build-cube))
>
> ; make a torus
> (define c (with-state
>     (parent a) ; create the torus parented to cube a
>     (build-torus 1 2 10 10))
>
> (with-primitive c
>     (parent b)) ; switch to b
>
> Also, I need to add this to the docs I think, but there are some rules
> regarding the primitive id's (which are really scene node id's).
>
> 0 = null scenenode (returned to represent nothing found, etc)
> 1 = root scenenode
Wouldnt it be better to have a variable like root-scenenode instead of
just 1, i know it is very little but would make it more readable(no need
to consult docs to know what is what)?

> anything else = a valid object
>
> So - if you have a primitive parented to some other object, and you want
> to detach it, call:
>
> (with-primitive myprim
>     (parent 1)) ; parent to the root node
>
> I'll try and come up with an example to show this stuff more clearly.
>
> * Bounding boxes are now created properly and actually useful for
> something - (bb-intersect) returns #t if the bounding boxes of two
> primitives intersect:
>
> (with-primitive prim1
>     (when (bb-intersect prim2 0)
>         (display "collision!")(newline)))
>
> The number is a threshold to expand (or shrink) the bounding box by to add
> (or remove) some safety margin. Use (hint-box) to view the bounding box.
>
> * More fluxa work, fixed some more buffer overflow errors, these are
> getting rarer, but something is still up in the sampler. Asserts are
> currently turned on in this code.
>
> cheers,
>
> dave



More information about the Fluxus mailing list