Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
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,
Solved! Go to Solution.
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;
}
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;
}