[Fluxus] commits
Dave Griffiths
dave at pawfal.org
Tue Nov 18 07:59:25 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)?
Yes, I agree. These are quite gory details which you probably don't need
to know. It might be better to have:
(define (detach-parent)
(parent 1))
There is a slightly more complicated function in fluxus (not exposed to
scheme yet) to allow this to happen while maintaining the worldspace
transform of the object - I should probably wrap this up in some coherent
manner too.
cheers,
dave
More information about the Fluxus
mailing list