[Fluxus] Detecting collisions without bumping stuff

Rolf Meinecke fluxus at jsilence.org
Tue Dec 11 13:22:25 PST 2012


Am 11.12.2012 um 21:14 schrieb David Griffiths:
> On 11/12/12 12:22, Rolf Meinecke wrote:
> No worries, great questions...

Thanks!


> The thing to try is the native fluxus intersection calls like
> geo/line-intersect - see here for more details:
> http://en.flossmanuals.net/fluxus/ch017_scene-inspection/
> 
>> The goal is to build some sort of 3D-Iannix (http://iannix.org). I'd
>> like to set up some static trigger objects which emit an OSC message
>> when they are touched by some other object.
> 
> bb/bb-intersect? might be sufficient depending on the shape of your
> objects...

Thanks. Will use that.
For now I simply let a cube collide with a ground-plane and kicked it around. Collisions galore!
Will continue with bb/bb-intersect for the next steps.

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.

Great fun!

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?

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.



Someone else is working on a kind of OSC multiplexer or hub, for that we don't have to send the OSC data from point to point.
Instead everybody can simply send to and receive from the hub/multiplexer. 

Best regards,

-rolf


Code for reference :

(clear)
(ambient (vector 0.9 0.2 0.8))
(collisions 1)
(gravity (vector 0 -0.5 0))
(ground-plane (vector 0 1 0) -2)


(osc-destination "osc.udp://192.168.169.22:5001")
(osc-send "/fluxus/start" "f" (list (time)))
(display (time))(newline)

(define trigger (build-cube))
(with-primitive trigger
    (scale (vector 0.8 0.8 0.8))
    (active-box trigger)
)

(define triggercolour (vector 0 0 0))

(define (animate)

    (with-primitive trigger
        (osc-send "/midi/cc" "iii" (list 0 55
                                   (inexact->exact (floor (+ 44 (* 20 (vector-ref (get-transform) 13)))))
                                    ))
        (when (has-collided trigger)
;            (osc-send "/midi/noteon" "iii" (list 0 18 100))
;            (osc-send "/midi/noteoff" "iii" (list 0 18 100))
            (kick trigger (vector 0 0.7 0))
            (set! triggercolour (rndvec))
            (osc-send "/midi/noteon" "iii" (list 0 15
                (inexact->exact (floor (* 100 (vector-ref triggercolour 0))))))
            (osc-send "/midi/noteon" "iii" (list 0 16
                (inexact->exact (floor (* 100 (vector-ref triggercolour 1))))))
            (osc-send "/midi/noteon" "iii" (list 0 17
                (inexact->exact (floor (* 100 (vector-ref triggercolour 2))))))
            (colour triggercolour)
        )
    )
)

(every-frame (animate))




More information about the Fluxus mailing list