Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
yes it is possible
Thanks, How to do that, can you please let me know the procedures
take slider widget in your 2D canvas. here you can see the properties of slider widget.
you can these properties like initial value 0 , maximum 360(u can take according your need ) and intervals you can decide like step.
you can refer below link for reference.
bind the value property with model by selecting SCALE factor from list.
then create application parameter of name scale.
now bind the value property to application parameter scale
now bind scale application parameter with label widget as shown in figure
so in preview label widget reflect the scaling value.
Thanks. But i want to show the same without slide bar?.
Hi @RK_9880418 ,
as already mentioned in the post , from the viewpoint of AR is not recommended techniques to scale down or up , because this will not represent the model with a real size and position But of course we can scale down and up the model. With button - means you can create e.g. two different buttons . The one for zoom in / scale to factor > 1 - fix factor e.g. 5.0 and other button which will zoom out / set the scale back to 1.0. This could be done by button where you will set the click event of both buttons. Example here for the down button
Here an example how such code could be define in the <view>.js :
//==================================================
$scope.scaleUp= function() {
$scope.setWidgetProp('model-1','scale', 5.0);
};
//==================================================
//==================================================
$scope.scaleDown= function() {
$scope.setWidgetProp('model-1','scale', 1.0);
};
//==================================================
We can also use one toggle button where scale on toggle and scale back on untoggle
but as already mentioned on the other point if the model has offset - in this case the offset will also scale and this will cause that the model will behave like jumping in specific direction. You need to know the model and to add a specific movement which will move the object back to the new origin at the same time when scaling.