"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

Touch Objects

please help me, i'm develope imagetargets app into my own app..my own app render a hospital building when my camera detect several marker..my problem is, i want make that when i touch the object from my device screen, "details" button appear ( like dominoes app do), and when i touch the "details" button, pop up window appear and show the information about my object..i'm not that expert with java and c++..can anyone help me please?? regards, Gyan

muhammadgyan

Tue, 05/31/2011 - 14:49

Maybe its to difficult, can someone tell me how to display a button after i touch an object??like dominoes sample..i try harder to understand the code in dominoes, but i cant..

Touching an object (i.e. picking) is a non-trivial 3D problem. The Dominoes sample uses object-oriented bounding boxes and does a line/box intersection test. There are a few steps to use this code: 1) Define a bounding box transform for your object.

muhammadgyan

Wed, 06/01/2011 - 17:48

Can you provide me a code i can use to pick the object in imagetargets.cpp ( like you said above )??dominoes.cpp use InitNativeCallBack ini native code, its hard to understand for me..because the imagetargets.cpp didn't use that method..

muhammadgyan

Thu, 06/02/2011 - 06:34

Kim, can you tell me the other game engine or tool that integrated with QCAR??because my device crash when start QCAR-Unity project..

I don't have any suggestions, you'll have to search for Android OpenGL ES game engines / physics engines. Integrating these won't be trivial either, but can be worth the effort for large projects. - Kim

muhammadgyan

Fri, 06/03/2011 - 12:23

Ok Kim, next, please tell me the details..what code/method i must export and edit form dominoes app into imagetargets app to picking object beside updatePickingTransform(), projectScreenPointToPlane(), and checkIntersectionLine() method..i really have to finish my problem about picking object comple

Start with getting the touch events from Java to native. The Dominoes project does this in a fairly complex way so it can handle multi-touch and dragging, you may want to simplify it.

muhammadgyan

Sat, 06/04/2011 - 09:23

You absolutely right Kim, i just wanna my a button appear if i tap on the object ( like dominoes app, the delete button appear if user tap on the domino object ),i dont need the method to render object due to my finger slide up or down..

I suggest making your life easier and only sending the tap event to native. That will cut out a lot of code copying from the Dominoes sample (and hopefully a lot of your compilation errors).

muhammadgyan

Mon, 06/13/2011 - 14:28

Hei thank you very much Kim, it works perfectly..i edited the method NativeTapEvent(). but my method works when i touch the screen, not only when i touch the object..why did that happen?? when i touch the object, i want my app display the button like dominoes, i follow the code to call the button.

[QUOTE]but my method works when i touch the screen, not only when i touch the object..why did that happen??[/QUOTE] Are you checking for intersections using the checkIntersectionLine method, as we discussed in the earlier posts?

muhammadgyan

Sun, 06/19/2011 - 12:48

Kim, i want a delete button appear after i tap the object i add this code in imagetargets.cpp : [CODE]void handleTapEvent() { //playSoundEffect(0); //displayMessage("Objek Disentuh"); QCAR::Vec3F intersection, lineStart, lineEnd; projectScreenPointToPlane(tapCoords, QCAR::Vec3F(0, 0

What does your JNI call (the call from native to Java) look like? Make sure you are using a valid Java environment, and make sure the method exists in the class you are calling up to.

muhammadgyan

Mon, 06/20/2011 - 15:33

this is my JNI call to java : [CODE]void showDeleteButton() { // For this application, buttons are handled by the Android SDK // Use the environment and class stored in initNativeCallback // to call a Java method that shows the delete button jmethodID method = javaEnv->GetMethodID(ja

In the Dominoes project the showDeleteButton() and hideDeleteButton() methods are located in the DominoesRenderer java class. Have you added these methods? Try printing something to the log from these methods to make sure they are getting called correctly (or use breakpoints!) - Kim

muhammadgyan

Tue, 06/21/2011 - 04:25

sorry, i make the mistake on the code before, i write the code to call the showdeletebutton like this : [CODE]void showDeleteButton();[/CODE] i fix the code into this : [CODE]showDeleteButton();[/CODE] sorry to bother you KIM.. regards, Gyan

muhammadgyan

Tue, 06/21/2011 - 14:32

Kim, i want my button show a dialog when i click on the delete button, i replace the code in GUImanager.java into this : [CODE]deleteButton = (Button) overlayView.findViewById(R.id.delete_button); deleteButton.setOnClickListener(new View.OnClickListener() { public void onClick(Vi

What sort of error are you seeing in the logs? When the app crashes in the Java code you should get some nice details, including error messages and line numbers. - Kim

muhammadgyan

Wed, 06/22/2011 - 15:02

this is my logcat details Kim, i really dont know what wrong with my code : [CODE]06-22 22:00:32.075: ERROR/AndroidRuntime(14337): FATAL EXCEPTION: main 06-22 22:00:32.075: ERROR/AndroidRuntime(14337): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an app