[Fluxus] Detecting collisions without bumping stuff

David Griffiths dave at pawfal.org
Wed Dec 12 00:13:53 PST 2012


On 11/12/12 21:22, Rolf Meinecke wrote:
> We had a rather successful day.
> 
> Today we managed to send data from a bouncing cube in Fluxus via OSC
> in Midi format through Moco to Ableton Live and had it generate a
> soundscape. Then forwarded the OSC messages to the video guy who'd
> use it in his pure data video player for scrubbing through some
> videos. Later I sent the random colour, which I had changed on every
> bounce, via OSC/Midi to some other guy who then set the colour of his
> DMX/LED lamps to the same colour the bouncing cube had. DIY Ambilight
> Deluxe, yeah.

Sounds amazing!

> Two tough spots:
> 
> Had to figure out how to convert the normalized data from float to
> integer. Fluxuses OSC sends zero, when the message format string
> specifies "integer coming" with "i" and the value is float. So this
> did not work even though I mangled them to be whole numbers. 17.0
> versus 17. Only the latter worked. Took me a while to dig up
> inexact->exact. Is there a better way to convert float to int?

inexact->exact is the one you want. Not sure why any float value
resolves to 0 in the osc message though.

> Second: (get-transform) seems to return a vector with roundabout 14
> values which represent x y z position and x y z rotation and such. I
> failed to find a any reference, which vector-ref resembles which
> value. I've been fishing for "x-Position" for a while. Any pointers
> to documentation of which vector-ref position represents which
> transformation value would be appreciated.

get-transform returns the 4x4 transformation matrix - which has
translation, scale and rotation all mixed up. You can get the total
translation it represents by transforming a point - eg:

(define (get-location prim)
  (with-primitive prim
    (vtransform (vector 0 0 0) (get-transform))))

You can also split the rotation from the scale to extract them too, but
that takes a little more maths... (normalise the top three rows of the
matrix to remove the scale leaving the rotation, then you can multiply
by the inverse of that to find the scale matrix)

cheers,

dave



More information about the Fluxus mailing list