Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
WHAT IS MATRIX? — Gideros Forum

Howdy, Stranger!

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

WHAT IS MATRIX?

Member
edited February 2013
Hi,
Just to let you know,I have done some research to understand what is exactly matrix in Gideros.
I have seen the page curl effect,and one more example(animated grass).
But still I do not get the core concept.
These are the things,that I am wondering.
What dose it do?
How can it help me?
How dose it work?

www.zoolax.com
Tagged:

• Member
I am with Zoolax on that one. May be a more detailed manual or a link to more information?...
• Guru
Me too as well as i have same feeling for the mesh apis

• Member
edited February 2013
@hgvyas123
I understand mesh can be a triangle ,but we can create that using the Shape api.
So what is the advantage of Mesh?
I feel these are powerful tools,(MESH AND MATRIX)
That is ,why I am keen to find out what they do?
How they can help us?
Why do we need them?
Thanks

Likes: hgvyas123

www.zoolax.com
+1 -1 (+1 / -0 )Share on Facebook
• Maintainer
Matrix itself is a simple set of values. Basically any table with data is matrix. So for example if we have a table where rows represent apps and columns represent markets and values of cell are downloads of specific app on specific market thus we have a download correlation matrix

In Gideros the matrix is used to represent transformation - the state in which object is transformed right now.

So if we have a matrix:
m11 m21 dx
m12 m22 dy

then:
m11, m12, m21, m22 – define rotation
m11, m22 – define scaling
m12, m21 – define skew
dx and dy – define translation of coordinate plane (offset)

Unit matrix represent default matrix when no transformation is performed:

1 0 0
0 1 0

Here is a Transform class for Gideros which performs matrix operations to perform transformations:
http://appcodingeasy.com/Gideros-Mobile/Abstracting-matrix-transformation-in-Gideros-Mobile

But in most cases, Gideros already abstracted rotation and scaling as Sprite methods, so unless you need some specific transformation, there is no really use of Matrix for you

Likes: hgvyas123

+1 -1 (+1 / -0 )Share on Facebook
• Maintainer
And for difference between Meshes and Shape:

Basically with Shape you can draw any shape easily by passing coordinate points.
In meshes you can draw in triangles (theoretically you could also draw any shape, but you'd need to represent it with triangles, which might get tricky).

Unlike in Shape, triangles in Mesh can be separated, means one triangle can be in one corner, other in other corner and it still will be one Mesh.
And you can control each vertex of a triangle separately, which means you could set separate fill colors and create gradients.

I don't know about antialising, but probably Meshes deal with it better than Shapes.

And for some reason unknown to me Meshes are faster for rendering than Shapes or even Bitmaps separately. But you can't for example transform images used in Meshes as scale or rotate them.

So you must consider limitations and benefits before using one or other object.

Hope that clears things up

Likes: code_monkey

+1 -1 (+1 / -0 )Share on Facebook
• Member
edited February 2013
@ar2asawseen
I am getting it slowly,I feel kind of what it can do,
But I have to mess around with it a bit more so it will sink in.
I love the part that we can skew images.
Thanks
www.zoolax.com