hypermails
hypermails

Reputation: 746

how does one transform / change the perspective of an image in titanium to provide 3D effect

I am trying to create a 3D effect in Titanium for an image.

can you please provide pointers on how to make an image that looks like

enter image description here

to look like

enter image description here

I looked at transform, create2dmatrix etc - but the documentation is not too clear for me.

 var image2 = Titanium.UI.createImageView ({
    image: '/giraffe.jpg',
    height: '323',
    width: "270",
    left: "1px",
    });

thanks..

Upvotes: 0

Views: 76

Answers (1)

hypermails
hypermails

Reputation: 746

ok.. after struggling with trying to understand the documentation, the following expriment fixed it for me.

var image2 = Titanium.UI.createImageView ({
image: '/giraffe.jpg',
height: '323',
width: "270",
left: "1px",
});

t.m34 = 1.0/1000;
t = t.rotate (20,0,1,0);
t = t.rotate (20,0,1,0);
img.transform = t ; 

and everything works fine..

Upvotes: 0

Related Questions