[Fluxus] sudden motion sensor support

gabor papp gabor.lists at mndl.hu
Sun Jan 18 11:53:04 PST 2009


unfortunately i'm a bit stuck with the pixel fbo/render-to-texture
support. the same code that works in a simple glut application does not
upload anything when used in fluxus.

to have a little break i played with the apple motion sensor:
http://www.youtube.com/watch?v=qrFCIMe-7aw

you need the unimotion library from http://unimotion.sourceforge.net/

my simple ffi module is attached.
usage example:

(require "unimotion.ss")

(define type (detect-sms)) ; detects laptop type

(display (read-sms-real type)) ; reads motion sensor data as a vector

any comments are welcome.

best,
gabor

---------- unimotion.ss ---------------

#lang scheme

(require scheme/foreign)

(unsafe!)

(provide detect-sms
        read-sms-real)

(define libunimotion (ffi-lib "libUniMotion"))

(define _mac-types
    (_enum '(unknown = 0
             powerbook
             ibook
             high-res-powerbook
             macbook)))

(define detect-sms
    (get-ffi-obj "detect_sms" libunimotion (_fun -> _mac-types)))

(define read-sms-real
    (get-ffi-obj "read_sms_real" libunimotion
        (_fun (t : _mac-types)
            (x : (_ptr o _double))
            (y : (_ptr o _double))
            (z : (_ptr o _double))
            -> _int
            -> (vector x y z))))



More information about the Fluxus mailing list