Start a new topic

Example activity 3d recognition (Native 1.1)

Example activity 3d recognition (Native 1.1)

Hi all,

I noticed there are examples for client recognition, rendering etc. But they are all using 2d recognition. The only examples for 3D recognition are recording and recording+recognition. I have trouble creating my own activity that only does the recognition. 

I am looking for an example + documentation of something like the ExternalRendering example but for point cloud recognition.


Thanks in advance.

Hi Laurens,

Did you use the following in your code:

ClientTracker tracker = mWikitudeSdk.getTrackerManager().create3dClientTracker("file:///android_asset/YOUR_MAP_NAME.wtm");

What exactly is your issue with the sample?

Thx and greetings


This is exactly what I used. I actually tried both of these:

File file = new File(mWikitudeSdk.getTrackingMapRecorder().getTrackingMapStorageLocation(), "testcv.wtm");
ClientTracker tracker = mWikitudeSdk.getTrackerManager().create3dClientTracker(file.getAbsolutePath());



ClientTracker tracker = mWikitudeSdk.getTrackerManager().create3dClientTracker("file:///android_asset/testcv.wtm");



Since I was not sure my point cloud was good enough I tried the following:

- Removed the deletion of the temp file in the example recording/tracking activity

- Started the recording/tracking activity to record a pointcloud and immediately test it. This works.

- The temp point cloud is now saved in the folder and I opened it with my own activity or with one of the example (internal/external)rendering activities, using above code. 

- Nothing happens. :(


Should I post my entire activity?

package com.wikitude.samples;

import android.os.Bundle;
import android.widget.Toast;

import com.wikitude.WikitudeSDK;
import com.wikitude.WikitudeSDKStartupConfiguration;
import com.wikitude.common.rendering.RenderExtension;
import com.wikitude.common.tracking.RecognizedTarget;
import com.wikitude.rendering.ExternalRendering;
import com.wikitude.samples.rendering.external.CustomSurfaceView;
import com.wikitude.samples.rendering.external.GLRenderer;
import com.wikitude.samples.rendering.external.Driver;
import com.wikitude.tracker.ClientTracker;
import com.wikitude.tracker.ClientTrackerEventListener;
import com.wikitude.tracker.Tracker;


public class LaurensActivity extends Activity implements ClientTrackerEventListener, ExternalRendering {
private WikitudeSDK mWikitudeSdk;
private GLRenderer mGlRenderer;
private CustomSurfaceView mView;
private Driver mDriver;


protected void onCreate(Bundle savedInstanceState){
mWikitudeSdk = new WikitudeSDK(this);
WikitudeSDKStartupConfiguration startupConfiguration = new WikitudeSDKStartupConfiguration(WikitudeSDKConstants.WIKITUDE_SDK_KEY, CameraSettings.CameraPosition.BACK, CameraSettings.CameraFocusMode.CONTINUOUS);
mWikitudeSdk.onCreate(getApplicationContext(), startupConfiguration);
File file = new File(mWikitudeSdk.getTrackingMapRecorder().getTrackingMapStorageLocation(), "testcv.wtm");
ClientTracker tracker = mWikitudeSdk.getTrackerManager().create3dClientTracker(file.getAbsolutePath());
//ClientTracker tracker = mWikitudeSdk.getTrackerManager().create3dClientTracker("file:///android_asset/testcv.wtm");

protected void onResume() {

protected void onPause() {

protected void onDestroy() {


public void onRenderExtensionCreated(RenderExtension renderExtension) {
mGlRenderer = new GLRenderer(renderExtension);
mView = new CustomSurfaceView(getApplicationContext(), mGlRenderer);
mDriver = new Driver(mView, 30);


public void onErrorLoading(ClientTracker clientTracker, String s) {


public void onTrackerFinishedLoading(ClientTracker clientTracker, String s) {


public void onTargetRecognized(final Tracker tracker, final String s) {
runOnUiThread(new Runnable() {

public void run() {
Toast.makeText(getApplicationContext(), "TREGEJIAS", Toast.LENGTH_SHORT).show();

public void onTracking(final Tracker tracker, final RecognizedTarget recognizedTarget) {

public void onTargetLost(final Tracker tracker, final String s) {

public void onExtendedTrackingQualityUpdate(Tracker tracker, String s, int i, int i1) {



Hi Laurens,

the example "1.3 Tracking 3D" does delete the recorded tracking map when you quit the sample. Please use the "Tracking Map Recorder" in the right upper corner of the Native SDK Example App to record a map and save it. 

To load a map in the same app you've recorded it, load it like you did here:

File file = new File(mWikitudeSdk.getTrackingMapRecorder().getTrackingMapStorageLocation(), "testcv.wtm");
ClientTracker tracker = mWikitudeSdk.getTrackerManager().create3dClientTracker(file.getAbsolutePath());

To load a map you recorded in some app, exported, and packaged as asset in another app load it like you did here:

ClientTracker tracker = mWikitudeSdk.getTrackerManager().create3dClientTracker("file:///android_asset/testcv.wtm");

When you run your sample now as posted here, it should work if you recorded your map with the "Tracking Map Recorder" and chose "testcv.wtm" as the file name.

Best regards,



I changed the "1.3 Tracking 3D" Activity so that I can record, test & save a tracking map. I needed to know whether I am doing something wrong or that the 3D map might just not be good enough.


private void deleteTemporaryTrackingMap() {
//File file = new File(_wikitudeSDK.getTrackingMapRecorder().getTrackingMapStorageLocation(), TRACKING_MAP_FILENAME);
//if (file.isFile()) {
// file.delete();


This leaves me a file for testing in my own activity.


About the loading: As I said I tried both. And I don't see anything. My logcat doesn't show any errors about loading or anything else. But I do not see any lines, squares or other demo augmentations.


Login or Signup to post a comment