Dive Board



GazeInputModule

GazeInputModule

by bartch on May 16th, 2015 08:13 AM

Hi all,
I'm using the Dive Unity Plugin for Android/IOS to make a demo for Android and IOS.
What i can't figure out is to create something that uses "gazing" as an event.

I know in the Cardboard SDK for Unity there is a GazeInputModule, but i don't know how to implement it.

My first project started by opening the Dive Unity Demo Project 2.1 and i am experimenting with it by altering the scene
and add some assets. Is it possible somehow to add the GazeInputModule.cs in this Dive Unity Demo Project?
So, if i look at an object, it wil trigger an animation after a while, instead of using the magnet?

Can somebody please help me to point me in the right direction?
thanks
Bart

bartch

Posts: 1

Joined: 16.05.2015


Re: GazeInputModule

by Torben on May 18th, 2015 09:53 AM

Hi!

We have our own gaze-only-input-module but are switching over to gaze+magnet and other inputs.

It is definitely possible to integrate cardboards gazeinput script into the dive unity demo -
you should give it a try and if you encounter some severe problems, we are eager to help :)

Best regards,
Torben

Torben

Posts: 63

Joined: 26.03.2014

dive-owner


Re: GazeInputModule

by ddutchie on May 19th, 2015 14:29 PM

Please explain.

I have: copied the script to my project, removed any references to the cardboard sdk. I then made a World Space Canvas with a button, but no cursor appears and button does not click.

ddutchie

Posts: 1

Joined: 19.05.2015


Re: GazeInputModule

by Torben on May 19th, 2015 17:51 PM

I'm sorry,
but there won't be enough time to do this for you any time soon :(

On the other hand, it's really simple to implement your own gaze input in unity:
You just need to know a bit about colliders and raycasts http://docs.unity3d.com/ScriptReference/Collider.html

Then it could look something like this for example:

<br />Ray ray = new Ray(transform&#46;position, transform&#46;forward);<br />RaycastHit hit;<br />if(Physics&#46;Raycast(ray, out hit, 10))<br />{<br />  if(hit&#46;collider&#46;gameObject==yourgameobject &amp;&amp; yourTime &gt;= YOURTIMETRESHOLD){<br />    doTheAction();<br />  }<br />}<br />

Torben

Posts: 63

Joined: 26.03.2014

dive-owner


Re: GazeInputModule

by StacyRomane on Jun 7th, 2024 12:37 PM

Your content is arby's happy hour menu always top-notch.

StacyRomane

Posts: 20

Joined: 06.01.2024


STATISTICS


Total posts: 171727


Total topics: 41609


Total members: 44854


Newest member: Daniel G.