Start a new topic

Communication from Titanium to ARchitectWorld

Communication from Titanium to ARchitectWorld


Yes, after oad vent, here my code:

~~~

architectWindow.arview.addEventListener('WORLD_IS_LOADED', function() {
            architectWindow.arview.callJavaScript( "World.init('" + JSON.stringify(options.data)+"');");
            
 });

~~~

 

This code works for me.

Hello, Ithink you shoul open first the ARworld and then call Eval.
best regards

Hi, Background: a REST-servise on Titanium side retrieves the 3D-model-URLs. The list of avalable models is shown in a tableview and depending on click the same tracker triggers and shows the related model in a new AR-window.

~~~

var ARModule = require('/apps/ar/ARchitect.window');
    var architectWindow = new ARModule('');
    if (architectWindow.isDeviceSupported()) {
        var url = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory,'apps', 'ar' , 'index.html').nativePath;
        architectWindow.loadArchitectWorldFromURL(url, , {
            camera_position : 'back'
        });
        architectWindow.callJavaScript('World.init("https://www.??/dev/AR/Interzoll_Modul.wt3");');
        architectWindow.open();
    } else {
        console.log('Warning: this device cannot play with ar');
    }
    return architectWindow;

~~~

The code above doesn't work. I cannot inject the JS-code. If I call in index.html the Word.init(URL); then is works.  Any ideas how I can control the model URL from Titanium namespace?

 

Code strong!

Rainer

 
Login or Signup to post a comment