Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Horsepower · Mar 14, 2012 at 08:40 PM · input

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 !!!

Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Horsepower · Mar 14, 2012 at 03:50 PM 0
Share

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!

avatar image Horsepower · Mar 14, 2012 at 03:51 PM 0
Share

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!

avatar image Horsepower · Mar 14, 2012 at 04:35 PM 0
Share

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?

avatar image Bunny83 · Mar 14, 2012 at 09:22 PM 1
Share

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.

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Help In Making a SphereCast for 3D Tire! Working RayCast Script included! 0 Answers

Right gamepad stick not working with Input System? 1 Answer

Input Help! 1 Answer

OpenXR Continuous Turn and Movement not working 0 Answers

IOS object touch, collider 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges