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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Is Model Item Translation Using JavaScript possible in Hololens?

AdamFagan
5-Regular Member

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;

};

1 ACCEPTED SOLUTION

Accepted Solutions

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

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

flamy
10-Marble
(To:AdamFagan)

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.

mwassmann
5-Regular Member
(To:AdamFagan)

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.

flamy
10-Marble
(To:mwassmann)

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

~ Francois

mwassmann
5-Regular Member
(To:flamy)

if you want share your project with me...

flamy
10-Marble
(To:mwassmann)

Thanks Martin, will send you the data directly

~ Francois

Top Tags