Page 1 of 1

GazeCam Sample with images

PostPosted: 17 Jan 2015, 21:48
by hou.hanru
Hello,

I am working with the GazeCam Unity Sample, and I wonder if the fact that the cube becomes red when looking is implemented in the script/code? How do I change this, if I for example want an image instead of colour to appear? I also wonder how do I change the fact that the colour of the cube is red only when looking and not once activated through gaze. I looked at the different scripts but I can only see one of them attached to the main camera. What are the others for?

Thanks for help :!:

Re: GazeCam Sample with images

PostPosted: 18 Jan 2015, 12:01
by Anders
How do I change this, if I for example want an image instead of colour to appear?


Take a look at the GazeCamera class and the checkGazeCollision method. Substitute the color with a texture.

...how do I change the fact that the colour of the cube is red only when looking and not once activated through gaze.


I am not sure I understand the difference between these two states?

What are the others [scripts] for?


Search the Unity scene graph and you will be able to see what GameObjects the scripts are attached to.

BR,
Anders

Re: GazeCam Sample with images

PostPosted: 19 Jan 2015, 05:23
by hou.hanru
Oh I see. And if the every cube should appear with different colour, I multiply the function?

...how do I change the fact that the colour of the cube is red only when looking and not once activated through gaze.


I mean if it possible that the cube stays red even when not looking anymore.


Best,

Re: GazeCam Sample with images

PostPosted: 19 Jan 2015, 10:36
by Anders
And if the every cube should appear with different color, I multiply the function?


If you want every cube to have a different color, then you need to implement the logic to handle it. That could be done by using different tags on every cube as identifies and then setting color accordingly. You could also add scripts to the cubes that handle this. You would most likely be able to find a tutorial about this in the official Unity forum.

I mean if it possible that the cube stays red even when not looking anymore.


Sure that is possible. Just alter the existing code or implement your own logic.