Skew/Distortion effect on a Sprite/Shape/Mesh - Gideros Forum

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Skew/Distortion effect on a Sprite/Shape/Mesh

Member
edited April 2015
Hello,

I want to make something like this image in gideros. How can i do it ?
I try on a sprite :
local t = Transform.new()

t:skew(45, 0)
t:apply(self)

But, it only rotate

Thank you

• Member
@jeromegsq I don't know the Transform class you are using there, but I know that you can skew sprites with matrix, take a look here:
http://docs.giderosmobile.com/reference/gideros/Matrix#Matrix

However to achieve the effect you're asking I suppose I would use a textured Mesh.
I think you just need to understand what @hgy29 did to create the Star Wars text effect here http://giderosmobile.com/forum/discussion/5518/creating-star-wars-like-text/p1
• Maintainer
Yes Meshes seems the right approach here
• Member
@pie @ar2rsawseen
Ok thank you very much, but can you please explain me how work this matrix ?
Because it will help me for my problem and for the texture on a 3D object too.

M11 M12 M21 M22 what is it ? Is this the 4 points of a sprite/texture ?
Tx Ty for me their are for the translation right ?

Also, can you tell me what the min and max value (for exemple color is between 0 and 255, here is this between 0 and 1 ?)

Thank you
• Member
@jeromesq
I didn't find this referenced anywhere, so take this as an unofficial answer by my tests it seems that matrix parameters are used as follows:
Matrix.new(scaleX, skewX, skewY, scaleY, translationX, translationY)

It seems that Matrix can do only "Affine Transformations" - http://en.wikipedia.org/wiki/Affine_transformation

I suppose there are no min/max values: but I am not a math guru (and I have no knowledge on matrices operations )
If I understood correctly, these should be multiplications on existing values (values taken from the Sprite on which you are applying the matrix transformation) - therefore, you have to see for yourself which min/max are suitable for your goal
• Maintainer
• Member
Thank you @ar2sawseen, it's good to know that
Maybe this info is worth to be included in Matrix docs for future reference