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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Can I display the percentage of scaling during zoom in or zoom up

RK_9880418
11-Garnet

Can I display the percentage of scaling during zoom in or zoom up

Hi,

 

I want to display the scaling percentage when zoom in or zoom out. Is that possible?. If yes, Please let me know the procedure. 

 

@HG @helu 

5 REPLIES 5

yes it is possible

Thanks, How to do that, can you please let me know the procedures

Suraj_Patil_0-1630653766200.png

take slider widget in your 2D canvas. here you can see the properties of slider widget.

Suraj_Patil_1-1630653894368.png

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.

http://support.ptc.com/help/vuforia/studio/en/index.html#page/Studio_Help_Center%2FBeginner_Bindings.html%23

bind the value property with model by selecting SCALE factor from list.

then create application parameter of name scale.

Suraj_Patil_2-1630654079394.png

now bind the value property to application parameter scale 

Suraj_Patil_3-1630654222863.png

now bind scale application parameter with label widget as shown in figure 

Suraj_Patil_4-1630654288825.png

 

so in preview label widget reflect the scaling value.

Suraj_Patil_5-1630654428796.png

 

 

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

 

 

2021-09-29_11-15-28.jpg

 

 

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.

Top Tags