Skip to main content
1-Visitor
January 22, 2020
Question

flipping a model

  • January 22, 2020
  • 1 reply
  • 1204 views

is there a way to flip a model in vuforia studio?

1 reply

15-Moonstone
January 22, 2020

Yes, there is a way to flip model through JS Code.

function flip(src,target){
 var img = new Image();
 img.onload = function(){
 var c = document.createElement('canvas');
 c.width = this.width;
 c.height = this.height;
 var ctx = c.getContext('2d');
 ctx.scale(-1,1);
 ctx.drawImage(this,-this.width,0);
 this.onload = undefined; 
 target.src=c.toDataURL();
 }
 img.src=src;
}

 

Please go through above example