- Home /
URGENT: Info request about run gyroscope with Input.acceleration Script in UNITY-3D !!!
I want reproduce the "Still Life" videoinstallation of Scott Garner with its "Phidgets Spatial 3/3/3" gyro sensor: http://scott.j38.net/work/interactive/still_life/
I bought "Phidgets Spatial 3/3/3" gyroscope sensor TODAY! in Italy: http://www.phidgets.com/products.php?category=5∏uct_id=1056_0
from Italian www.Robot-Italy.com vendor.
All run OK!
In the "Phidgets Control Panel" interface all the indicators run...
I seen "Phidgets Spatial" icon, in "Others Device", in "Print and Device" Control Panel, on Windows7-Ultimate-x64Bit.
(I don't know if is it possible to select this device as "preferred", on someone Windows7 panel...)
I also upgraded my Unity3D software (and also my little scene projects), from version 3.4.2f3 to version 3.5.2f5
My questions are:
1) How to use the Input.acceleration Script to run in conjunction with a gyroscope?
2) I tried the Input.acceleration Script but nothing happens!
3) What parameters should I modify in the Script to run correctly?
4) You are sure, that the "Phidgets Spatial 3/3/3" gyro sensor, don’t need any Input “Type”, in the Input Manager, of Unity3D, to run? (such WindowMovement, Joystick, Keys, or Mouse?)
5) Any gyro, tablet gyro, iPhone gyro, etc… run just with Input.acceleration Script?
I am desperate !!!
Scott Garner don’t have responsed me!
If the gyroscope product doesn’t work with Unity3D, I am forced to return the product to the seller within 7-10 days !!!
Help !!!
Please, Help !!!
Scott Garner directly response me!
Can anyone confirm this?:
"Hi Dario,
As far as I know, there is no direct way to have a Phidgets sensor communicate with Unity. The way I did it was to modify one of the simple C applications they provided (the accelerometer example, I think) to write the data to a text file as it updated. Then I used Unity to look at that text file during its update routine. Another option would perhaps be some kind of strea$$anonymous$$g web service that Unity connected to, but honestly the text file hack was simple and worked well enough for me..."
Best, Scott.
Can anyone help me to write the text file?
Can anyone, give me more info about make a Script in Unity3D, or make a way, in Unity3D, to look at that text file during its update routine?
Help!
Please Help!
I am desperate!
Scott Garner writed me:
"Hi Dario,
I generally don't $$anonymous$$d people duplicating my work as a learning experience, I think that's great, but I don't have the time or inclination to completely guide someone through the process. I am also currently traveling and don't have ready access to any of the Still Life work, but it really is very simple.
To give a overview:
Look at the examples from Phidgets, I think there is one called something like simpleacceleromter.c or something similar that shows how to read spatial data. Normally, that program just spits out the data it reads to the ter$$anonymous$$al, but it was very easy to change it to write to a file.
In my case the text file itself always had one line and looked something like:
.5 .5 .5
All I wrote was the current x, y and z values from the accelerometer.
I don't remember the exact Unity functions to read a text file, but I know I found the info either at answers.unity3d.com or Stack Overflow. I read the file, split the values into variables and then used the appropriate value to rotate the camera. The math to do this took a little experimenting, but was really just a few lines of code.
Good luck with your progress,
-S..."
The "Accelerometer-simple.c" TEXT FILE: http://www.phidgets.com/downloads/examp ... 216.tar.gz
How to modify it to .5 .5 .5 ?
Where I should put this numbers?
I am Italian, I had basic English language, and I am beginner programmer!
Help!
Scott writed: " I read the file, split the values into variables and then used the appropriate value to rotate the camera. "
Thus:
1) I created one TEXT FILE called "Values.txt"
2) I put (0.5,0.5,0.5) line code in the .txt
3) In Unity I " Created a text asset in the game object and then drag and drop your txt file into the text asset slot in that game object." As writed in this thread called "Reading a .txt File":
http://answers.unity3d.com/questions/153263/reading-a-txt-file.html
In the Unity, Javascript Text Asset, I writed 2 code lines:
string fileRead = Values.text;
string[] lines = fileRead.Split('n');
But it appears this eror message:
"Assets/Read TXT File.js(1,7): UCE0001: ';' expected. Insert a semicolon at the end."
-Why?
-What I should write in Javascript or C#Script, to read the values .txt file?
Seriously! this question is a mess. Nothing is formated in a way that it makes sense. Why is every fourth word bold?
Phidgets also privides a .NET assembly to access any of their products, so there should be no need for a c-wrapper-program. It also seems they have quite a good documentation of their products and their API.
These lines are C# code. You put it in a .js file.....
string fileRead = Values.text;
string[] lines = fileRead.Split('n');
$$anonymous$$y guess is that it should be possible to use it in Unity, but of course with their API. AFAI$$anonymous$$ Unity's Input.acceleration can only be used to access the build-in acceleration sensor of mobile devices.
It seems you have no idea what you actually doing here. So if you don't have enough experience you should hire a programmer, but don't expect anyone on this Q&A site to read into the documentation of a third-party hardware interface to provide you an out-of-the-box-solution.