cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Limitations of Vuforia Studio compared to Unity

Laurenz
7-Bedrock

Limitations of Vuforia Studio compared to Unity

Hi,

I am currently working on getting my feet wet with Vuforia Studio and am trying to reimplement a Usecase from Unity within Vuforia Studio.

I am now curious about the limitations of Vuforia studio. The usecase is an AR  app for the Microsoft Hololens augmenting a machine, showing a customized 3D UI, that allows the user to interact with 3D buttons and the machine itself. (This is currently implemented with Unity and Vuforia SDK)

As far as i have seen now, Studio has events for hololens gestures like holding, doubletap, swiping, but i cannot seem to get a normal "click" working.  The JS field for "click" on a model itself doens't seem to be triggered by a hololens click ?!?

Am I missing something? Is it possible to interact with the scene and its models (colliders), buttons, etc.  like it is in Unity? 

Can i get REST Api calls from a Vuforia studio javascript function or do i need to have Thingworx composer running in the background for that?

(I am currently only working with the trial version, which has a composer, but I cannot create any new things etc, because of restricted permissions)

 

 The default Home.js is the place where all javascript functions are stored. is there a possibility to create a second file to reduce the size of that single file and to tidy up things a little bit?

 

Can't we select multiple objects in the Editor, or group them together, so you can reposition multiple elements all at once? (also having a shared pivot point for multiple objects by grouping would be handy too)

 

And final question. is there a nice documentation available for all the keywords used ike $scope, $element etc. and how to use it properly?

1 ACCEPTED SOLUTION

Accepted Solutions
Laurenz
7-Bedrock
(To:Laurenz)

Indeed, I was missing something. I made an error invoking the function not properly. Clicking 3D widgets with the Hololens works as intended now. 

View solution in original post

5 REPLIES 5
Laurenz
7-Bedrock
(To:Laurenz)

Indeed, I was missing something. I made an error invoking the function not properly. Clicking 3D widgets with the Hololens works as intended now. 

Yes clicking on 3d widget works fine.

But another approach is to have a second model loaded which will implemented your 3d UI.

So for example an assembly which display a board with different buttons. So you can define a button as modelitem and use the modelitem click event so when you click on the button.

Additionaly when you click the button you can moved it in one direction so it should implements  "pressed" status or after some delay it could move back to the original possition. 

In same case if required you can hide or show some part of you UI according your requirements.

Thanks for the idea of implementing the UI as an actual 3D model with model-items. That is a workaround i could live with. 

 

Also thank you for the tip with loading a js file from the resources.

I will have a look at the angularJS GET POST documentation link you provided an will try to reimplement my Get requests from my Thingworx trial within studio.

jmikesell
15-Moonstone
(To:Laurenz)

Sounds like you got the click figured out. As for the rest of your questions I'll take a stab.

  • Multiple JS files
    • There is a loadResourceScript function i have not tried it but Clay knows what he is doing.
    • https://community.ptc.com/t5/Studio/Including-js-file-from-resources/m-p/556859/highlight/true#M3490
    • related but you can read in JSON data from files as follows
      $scope.loadJSON = function (file, callback) {
          var xobj = new XMLHttpRequest();
          xobj.overrideMimeType("application/json");
          xobj.open('GET', file, true);
          xobj.onreadystatechange = function () {
              if (xobj.readyState == 4 && xobj.status == "200") {
                  // Required use of an anonymous callback as .open will NOT return a value but simply returns undefined in asynchronous mode
                  callback(xobj.responseText);
              }
          };
          xobj.send(null);
      }
      
      $scope.loadJSON("app/resources/Uploaded/fileName.json", function (response) { // this is the file to load
          partsJSON = JSON.parse(response);
          console.log('parts JSON loaded:', partsJSON);
          $scope.app.fn.addSnackbarMessage('Parts data Loaded');
          console.log($scope.app);
      }
  • API Calls
    • I'm still not exactly sure what REST is but if you wanted to make call out of your Studio created experience you can the angular $http service is available so you can do GET and POST
  • Grouping and moving item
    • This is a really needed feature but is not there.
    • The entire experience minus resources is one JSON file and you can edit this directly and then just reopen your project and the changes will show. I have done this when i want to move a lot of stuff or create a bunch of widgets with similar features.
    • That file is located  in [Vuforia Studio Install directory]/projects/[your project name]/src/phone/components
    • The Home.js file is also here and you can edit it in a more featured external editor like VS Code
  • Documnetation
    • Also really needed
    • There is no PTC provided documentation on pretty much anything JS related.
    • This forum is the best source of info on JS in Studio i have found.

 
Top Tags