Using accelerometer to control multiball so it bounces?
Using accelerometer to control multiball so it bounces?
Hi there,
I have a question regarding the accelerometer in combination with multiball.
I would like to control the multiball using the accelerometer in such a way that it if you tilt your iPad/iPhone the ball falls to the specific side of the screen in a straight line. However...I would like it to bounce to the side as if it hits the floor like a ping pong ball. If you tilt the iPad/iPhone to the other side the ball should follow.
At this moment I have the ball following the accelerometer using this script:
y=(accelerometer[0]*-1+1)/2;
x=(accelerometer[1]+1)/2;
But it doesn't bounce yet. Any ideas on how I could accomplice this?
Thanx!
Fourier
I have a question regarding the accelerometer in combination with multiball.
I would like to control the multiball using the accelerometer in such a way that it if you tilt your iPad/iPhone the ball falls to the specific side of the screen in a straight line. However...I would like it to bounce to the side as if it hits the floor like a ping pong ball. If you tilt the iPad/iPhone to the other side the ball should follow.
At this moment I have the ball following the accelerometer using this script:
y=(accelerometer[0]*-1+1)/2;
x=(accelerometer[1]+1)/2;
But it doesn't bounce yet. Any ideas on how I could accomplice this?
Thanx!
Fourier
Re: Using accelerometer to control multiball so it bounces?
that's a funny idea, but I believe this is not the way these elements are intended to use. Both multiball and accelerometer are input devices, separate input devices. They are here to use for a certain purpose, not to control each other. I understand the fun in moving the balls with the movement of the iPad, but I think you are missing the true purpose of those elements.
A ball moving along the physical movement of an iPad makes the ball an output device, which it isn't. Excuse my horrible English, but do you get my idea?
A ball moving along the physical movement of an iPad makes the ball an output device, which it isn't. Excuse my horrible English, but do you get my idea?
Formant+Eurorack, PPG wave 2.2, Korg MS-20, etc., EWI 4000s, QuNeo, etc., Mixbus32c, u-he, MadronaLabs, Samplemodeling, NI, etc., iPad2/4/Pro
Re: Using accelerometer to control multiball so it bounces?
H!,
I want to know which data five by accelerometer .
accelerometer[0]= what,accelerometer[1]= what ,accelerometer[2]= what ???
and is it possible to translate accelerometer in {x,y,z} ????
I want to know which data five by accelerometer .
accelerometer[0]= what,accelerometer[1]= what ,accelerometer[2]= what ???
and is it possible to translate accelerometer in {x,y,z} ????
Re: Using accelerometer to control multiball so it bounces?
Hi Phil,Phil999 wrote:that's a funny idea, but I believe this is not the way these elements are intended to use. Both multiball and accelerometer are input devices, separate input devices. They are here to use for a certain purpose, not to control each other. I understand the fun in moving the balls with the movement of the iPad, but I think you are missing the true purpose of those elements.
A ball moving along the physical movement of an iPad makes the ball an output device, which it isn't. Excuse my horrible English, but do you get my idea?
I understand what you mean. It would be great if the Multiball object could be controlled via OSC so I can do the scripting on the computer. I have a script that does it for my Monome 64 which has also an accelerometer.
I guess I need to do some rethinking.
-
- Liine Staff
- Posts: 126
- Joined: 14 Dec 2011 12:12
Re: Using accelerometer to control multiball so it bounces?
Well you can control the Multiball from the outside, by sending it /Multiball/x and /Multiball/y messages.
You could also simulate some physics using the accelerometer in the script engine, I'll try to come up with an example for you.
You could also simulate some physics using the accelerometer in the script engine, I'll try to come up with an example for you.
-
- Liine Staff
- Posts: 126
- Joined: 14 Dec 2011 12:12
Re: Using accelerometer to control multiball so it bounces?
A short one as promised. Will make it more customizeable for the User Lib.
- Attachments
-
- gravity.jzml.zip
- (1.33 KiB) Downloaded 305 times
Re: Using accelerometer to control multiball so it bounces?
Hi Axel,
Thats great!!!! It works like I wanted. Only reversed but will fiddle around with the code.
Thanx a million. I don't think I could have done this in this short time.
Fourier
Thats great!!!! It works like I wanted. Only reversed but will fiddle around with the code.
Thanx a million. I don't think I could have done this in this short time.
Fourier
Re: Using accelerometer to control multiball so it bounces?
and what about accelerometer[2] ?
Re: Using accelerometer to control multiball so it bounces?
What do you mean?studioda wrote:and what about accelerometer[2] ?
Re: Using accelerometer to control multiball so it bounces?
I notice that all template which use accelerometer ,utilise only accelerometer[0] and accelerometer[1] but why not accelerometer[2]?fourier wrote:What do you mean?studioda wrote:and what about accelerometer[2] ?