Skip to main content
8-Gravel
May 17, 2017
Solved

Is Model Item Translation Using JavaScript possible in Hololens?

  • May 17, 2017
  • 3 replies
  • 4557 views

I want to explode a model using model items and then reset it.  I am able to do this in the mobile environment and in the preview of the Hololens using the click JS.  I've added my explMdlItem(); to the JS of the hold event and my reset(); to the JS of the doubletap event but I'm not sure where to go from here.  It appears I'm only able to bind the events to the services of the model which doesn't work  Is this even supported?  Here is my JS:

$scope.explMdlItm = function() {

$scope.app.params.zCoordFront += 0.1;

$scope.app.params.yCoordTop += 0.1;

$scope.app.params.xCoordMiddle += 0.1;

};

$scope.reset = function() {

$scope.app.params.xCoordMiddle = 0;

$scope.app.params.yCoordTop = 0;

$scope.app.params.zCoordFront = 0;

};

Best answer by katte

Yeah using JS is possible with HoloLens!! 

With only exception to define the function as "$scope.app.<function-name> = function() {. .... /code// };"

And in the click JS event box, call the function as "app.<function-name>();"

3 replies

katte5-Regular MemberAnswer
5-Regular Member
May 18, 2017

Yeah using JS is possible with HoloLens!! 

With only exception to define the function as "$scope.app.<function-name> = function() {. .... /code// };"

And in the click JS event box, call the function as "app.<function-name>();"

12-Amethyst
May 18, 2017

Seems to work on the model but not on Model Item ... I just tried a different approach that yours  and got similar issue  :

Create Application parameter  MoveX ,

Add JS to doubletap event :   app.params["MoveX"]= 0.1+app.params["MoveX"]

If I bind MoveX to X Coordinate on Model , it works , the complete model move when I doubletap .. If I bind it to X Coordinate on Model Item .. nothing happens.

5-Regular Member
June 14, 2017

Works for me though...

(old project not republished with TWX studio 😎  - it was published with 1.12...

but using the newest view app on Hololens.

12-Amethyst
June 14, 2017

Thanks .. not sure why he does not work anymore for me . .this was an experience I just republished in TW 8 , no changes

~ Francois

5-Regular Member
June 14, 2017

if you want share your project with me...