N95 accelerometer with Blender
Hi, after one busy week I managed to release this first simple demo that shows you how to use the n95 accelerometer as an input device in Blender
The application is structured in this way:
- Mobile client, a python script which reads the accelerometer data and sends it via bluetooth to the pc
- A server that runs on your pc and shares the data with the BGE through a local UDP non-blocking socket
- A Blender script which handles the cube rotation in the BGE using the n95 accelerometer’s data
Why did I use a local socket? Sometimes I experienced some lag using pyserial in Blender, so to avoid that my idea was to use a non blocking socket. With this approach I had a smooth game running in Blender without any lag.
What do you need to run this? A Nokia N95, a PC/Laptop with a BT connection and Blender of course!
You need to install PyS60 on your Nokia phone from here. Download both PythonForS60_1_4_5_3rdEd.sis and PythonScriptShell_1_4_5_3rdEd_unsigned_testrange.SIS you need to sign the ScriptShell otherwise the accelerometer data won’t be retrieved by the script due to security reasons of Nokia phones. You can sign it from https://www.symbiansigned.com/app/page using “Open signed online”. I’m going to put the source code of what I did really soon, I want to improve a little bit some part of the code to make it more stable. However even though the scenario I present in this video is really simple, it’s a way to show you how Blender is really powerful (besides modeling, animating, composing, whatever
), Python is really one the strongest features that Blender has, since it makes the possibilities of interaction with other apps, device etc, endless.
Try for example to imagine the N95 as a joypad for a Blender game WipeOut style (I personally hate WipeOut, but somebody may love it
).
So enjoy the video and if you have feedbacks, questions, comments, feel free to ask!
Edit: sources available! Click here to download blender95!
Akta
June 14th, 2009 at 11:52 am
Amazing. Never thought about such things.
Ok, also I’m not programmer:)
June 14th, 2009 at 12:32 pm
Cheers, well there are plenty of things that you can do using Blender and Python
Soon I’ll update an example of object tracking using python and Blender
June 14th, 2009 at 9:44 pm
[...] app via Python and Python script. Watch the video below to see how it’s done and visit his site to tell him if it’s you think it’s as cool as I [...]
June 15th, 2009 at 12:26 pm
[...] N95 accelerometer with Blender [via BlenderNation] [...]
June 15th, 2009 at 12:31 pm
[...] N95 accelerometer with Blender [via BlenderNation] Read more | Permalink | Comments | Read more articles in Cellphones | Digg this! Posted by Adam Flaherty at 11:30 am. Filed under Uncategorized [link] [...]
June 15th, 2009 at 12:34 pm
[...] N95 accelerometer with Blender [via BlenderNation] Read more | Permalink | Comments | Read more articles in Cellphones | Digg this! [...]
June 15th, 2009 at 1:18 pm
[...] N95 accelerometer with Blender [via BlenderNation] [...]
June 15th, 2009 at 5:20 pm
[...] N95 accelerometer with Blender [via BlenderNation] [...]
June 20th, 2009 at 9:36 pm
never knew the n95 has an accelerometer…
I just installed python on my iphone, but I have trouble finding the module that gives access to its hardware. did anyone try it?
anyway, love the way u used blender..
July 4th, 2009 at 4:47 pm
Have you considered pursuing this technique as a camera tracking method? If camera motion info could be captured live on set using a camera mounted accelerometer linked directly to a digital camera in a 3d app it could eliminate the need for complicated tracking markers, software and cut hours off the camera matching process.
July 9th, 2009 at 10:36 pm
It seems you have provided just what I have been looking for but not to play games. I am after a method of recording my N95 accelerometer’s output (x,y,& Z) and saving to my laptop. I am not a programmer and don’t understand how to use Blender’s rar file and also how I can simply utilise your work to achieve my aim. Can you assist me please ?
July 11th, 2009 at 11:11 pm
hi dudes,
I don’t understand much of this but i’ a 3d designer and lately a question has been popping up in my mind:
Can i run blender on an S60 OS phone like i was using it on my pc with wi dows?
August 8th, 2009 at 1:50 pm
wow, it’s a great bit of programming you’ve achieved!
i tried it myself, but when i open the server on the computer, i get this error:
Traceback (most recent call last):
File “blender95_server.py”, line 18, in
import serial,socket
ImportError: No module named serial
does anyone know whats gone wrong?
email me if you wish : all.about.the.singh@hotmail.co.uk
August 30th, 2009 at 3:59 pm
Cheers!
It says that because you don’t have pyserial installed on your machine! Google for it and enjoy Blender95!
January 14th, 2010 at 5:24 am
hi, its only compatible, whit n95? or whit any S60 phone, i tried on 5530 sv5 and i cant run it, help me please
January 14th, 2010 at 10:02 pm
It’s compatible with every Nokia phone provided of accelerometer of course
January 16th, 2010 at 10:38 pm
Mobile phone with accelerometer can scan video from camera and simultaneosly detect accelerometer data, whereas moving phone around the scaned object, and then from this data create 3d object in blender?