Skip to main content
9-Granite
September 8, 2022
Solved

How to highlight part by using 2D button

  • September 8, 2022
  • 1 reply
  • 1437 views

Hello community,

 

I am beginner on vuforia Studio.

I have developed ball shooting system project. In this project, I put model item on ball and swivel angle. (Below, I attach screenshot of developed project screen please check out this.) Now, I want to highlight the parts by using 2D button. Can anyone please tell me how should I do this?

 

Thanks and regards,

Nilam 

Best answer by Mohit_Kabra27

Hello @NP_10149671 ,

 

There are ways to achieve this, when you say you want to highlight the part do you mean you just wish to change the color or you also want to apply some shader to it.

If you want to simply change the color you can use the below code and call the function at respective 2D-button

 

$scope.colorchange = function(){

$scope.setWidgetProp('modelItem-1', "color", "rgba(255,0,0, 1)");
}

 

If you wish to apply shader, you can refer this link : https://community.ptc.com/t5/Vuforia-Studio/TML-widget-X-ray-shader/m-p/603526

 

Hope this helps

 

BR,

Mohit

1 reply

5-Regular Member
September 9, 2022

Hello @NP_10149671 ,

 

There are ways to achieve this, when you say you want to highlight the part do you mean you just wish to change the color or you also want to apply some shader to it.

If you want to simply change the color you can use the below code and call the function at respective 2D-button

 

$scope.colorchange = function(){

$scope.setWidgetProp('modelItem-1', "color", "rgba(255,0,0, 1)");
}

 

If you wish to apply shader, you can refer this link : https://community.ptc.com/t5/Vuforia-Studio/TML-widget-X-ray-shader/m-p/603526

 

Hope this helps

 

BR,

Mohit