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

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Is Model Item Translation Using JavaScript possible in Hololens?

AdamFagan
8-Gravel

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;

};

ACCEPTED SOLUTION

Accepted Solutions
katte
12-Amethyst
(To:AdamFagan)

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
katte
12-Amethyst
(To:AdamFagan)

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
12-Amethyst
(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.

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
12-Amethyst
(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
12-Amethyst
(To:flamy)

if you want share your project with me...

flamy
12-Amethyst
(To:mwassmann)

Thanks Martin, will send you the data directly

~ Francois

Announcements

Top Tags