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

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

Hide/show 3D Image after clicking on 3D model

ppandarkar-2
15-Moonstone

Hide/show 3D Image after clicking on 3D model

Hello developers,

I was trying to implement simple on/off process of 3D image. With using 2D button I am able to on/off the 3d images but my project requires me to use 3D model as button. Is this possible? 

 

Looking for some sample code to help me understand the process.

 

Regards,

 

1 ACCEPTED SOLUTION

Accepted Solutions

The JavaScript below can be used to toggle the visibility of an image.

Add toggleImage  to the click event on the model and pass the studio id for example toggleImage("myImage");

 

console.log($scope.app) ;

$scope.toggleImage = function (myImage) {
      $scope.view.wdg[myImage].visible = !$scope.view.wdg[myImage].visible;
}

View solution in original post

2 REPLIES 2

Hi @ppandarkar-2 ,

yes you can handle the click on a 3D model via the userpick event. The following links are related -

1.)How can we make a 3D Widget on HoloLens visible in front of me everytime ?

2.) How to create a custom button pressable on HoloLens device?

Ok the described techniques is more advanced -and the example are for the HoloLens  but you see the usage in 2.) of the userpick - this should work also for mobile devices

The JavaScript below can be used to toggle the visibility of an image.

Add toggleImage  to the click event on the model and pass the studio id for example toggleImage("myImage");

 

console.log($scope.app) ;

$scope.toggleImage = function (myImage) {
      $scope.view.wdg[myImage].visible = !$scope.view.wdg[myImage].visible;
}

Top Tags