Software Archive
Read-only legacy content
17061 Discussions

RealSense(F200) to touch action

康夫_上_
Beginner
380 Views
How do you do. I'm working as an office worker in Japan. Using Intel realsense SDK and Unity5. An application development is being performed. There is a point 1 point isn't understood, so I'll question. It may be an elementary question, but make them recognize a fingertip by a sensor and make indicate a pointer. UI, when I touch, are they able to change a scene and play animation? If there is a sample code, if possible, is it all right to see it? When you can lend the help, it's lucky. Thank you.
0 Kudos
1 Reply
MartyG
Honored Contributor III
380 Views

English:

Hello!

I think that what you are asking is: can you change a scene when you use the camera to move a pointer over a UI element and touch it?

Yes you can change a scene like this.  :)

How I did this in my own project is to make an object (a finger) and move the finger object forward so that it touched a UI element on a screen.  Here is an episode from our development diary series that shows how we made and programmed this.

http://sambiglyon.org/?q=node/1264

This system could also be used to change the scene or activate the animation, by putting the script for the scene change or animation inside the UI element that you are touching.

For example, here is a JavaScript script that changes the scene.

function OnTriggerEnter () {
Application.LoadLevel ("PUT NAME OF YOUR SCENE FILE HERE");
}

The OnTriggerEnter type of function means that when your pointer object enters a collider field surrounding the UI element object, the script inside that element will be automatically activated.  So if the scene change script is inside, touching the UI element with the pointer object will make the scene change.

I would be happy to answer any other questions you have.  Good luck!

Japanese:

こんにちは!

あなたは、UI要素の上にポインタを移動し、それに触れてカメラを使用するときにシーンを変更することができます。私は何を求めていることであると思いますか?

はい、あなたはこのような場面を変更することができます。 :)

私は自分のプロジェクトでこれをやったどのオブジェクト(指)を作り、それが画面上のUI要素に触れたように、前方の指のオブジェクトを移動することです。ここでは、作られ、これをプログラムする方法を示して我々の開発日記シリーズのエピソードです。

http://sambiglyon.org/?q=node/1264

このシステムはまた、シーンを変更したり、あなたが接触しているUI要素内のシーン変化やアニメーションのスクリプトを置くことによって、アニメーションを活性化するために使用することができます。

例えば、ここでシーンを変更するJavaScriptのスクリプトです。

function OnTriggerEnter () {
Application.LoadLevel ("
ここにあなたのシーンファイルの名前");
}

関数のOnTriggerEnter型はポインタオブジェクトがUI要素オブジェクトを囲むコライダーフィールドに入ったとき、その要素内のスクリプトが自動的に起動されることを意味します。シーンチェンジスクリプトが内側であれば、ポインタオブジェクトとUI要素をタッチすると、シーンチェンジを行います。

私はあなたが持っている他の質問に答えて幸せです。幸運!

0 Kudos
Reply