Log in or register to post comments

Touch 3DModel on the screen ang open a GUIwindow

July 29, 2013 - 8:22pm #1

I have a project and when the user Touch the 3DModel on the SCREEN it needs to open a GUIwindow or GUIButton for example..

What i have done so far was I created a script that will make a Gui.button and I injected it on the object model but the GUI.button is fixed on the screen from the start of the app..

Please guide me Im a newbie in Unity and vuforia..

Im having a hard time on this Im 10 days searching and trying and still stock up on this part so i decided to post it my problem

Thanks in advance

Touch 3DModel on the screen ang open a GUIwindow

July 31, 2013 - 8:24am #6

AlessandroB

paatz04

DavidBeard

 

Thank you thank you thank you  for all of you guys..
I figure it out with the help of each of you .I found the exact answer in the forum of unity and I just combine all your answers and boom i get it right...
 thanks again more powers to you guys..
 

Touch 3DModel on the screen ang open a GUIwindow

July 30, 2013 - 6:20pm #5

There is sample code at the beginning of this thread that demonstrates how to handle touch events, and to customize the event handling for each object that is touched using the approach that paatz04 alludes to - https://developer.vuforia.com/forum/unity-3-extension-technical-discussion/how-add-touch-listener-3d-object-unity

Basically you're using Unity's SendMessage function to call the OnMouseDown method on the GameObject that is hit by the ray.

Touch 3DModel on the screen ang open a GUIwindow

July 30, 2013 - 5:45pm #4

i already try the raycast and maybe
there is something wrong in my script.. im gonna check it again and again..

and one last question..

do i need to make individual raycast script for every different model so whenever what AR model appears on the screen they could have different functions when I touch each of the model??

thank you so much and im sorry for posting it here..

Touch 3DModel on the screen ang open a GUIwindow

July 30, 2013 - 9:16am #3

why don't just attach a script on the Model you would like to click on, set a Touch or Mouse Listener on that and then open your GUI ?

Touch 3DModel on the screen ang open a GUIwindow

July 30, 2013 - 3:01am #2

Hi, in general you can use the raycast method:

Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit hit = new RaycastHit();
if ( myMesh.collider.Raycast(ray, out hit, 2500)) {
  // DO something...
}
 
However your question (touching 3D model and showing GUI) does not appear related to the Vuforia SDK and API;
for more details it is best to consult the Unity website or to post your question on the Forum of the Unity website:
 
Log in or register to post comments