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

Is Model Item Translation Using JavaScript possible in Hololens?

SOLVED
Visitor

Is Model Item Translation Using JavaScript possible in Hololens?

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;

};

Tags (2)
1 ACCEPTED SOLUTION

Accepted Solutions

Re: Is Model Item Translation Using JavaScript possible in Hololens?

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>();"

View solution in original post

6 REPLIES 6

Re: Is Model Item Translation Using JavaScript possible in Hololens?

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>();"

View solution in original post

Re: Is Model Item Translation Using JavaScript possible in Hololens?

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.

Re: Is Model Item Translation Using JavaScript possible in Hololens?

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.

Re: Is Model Item Translation Using JavaScript possible in Hololens?

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

~ Francois

Re: Is Model Item Translation Using JavaScript possible in Hololens?

if you want share your project with me...

Re: Is Model Item Translation Using JavaScript possible in Hololens?

Thanks Martin, will send you the data directly

~ Francois