Howdy, Stranger!

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

What is a matrix?

edited July 2012 in Questions Posts: 49

Hi, I was exploring codea and found matrix, what is a matrix?

Tagged:

Comments

  • Posts: 2,161

    It's a grid of numbers. In codea, the native matrices are 4x4, meaning that they have four rows and four columns. The identity matrix is thus:

    1 0 0 0
    0 1 0 0
    0 0 1 0
    0 0 0 0
    

    If you want more details, you should explain what context you are talking in - conceptual or coding.

  • Posts: 49

    Ok, whats help me a matrix when i programming? or what is the funcionality of a matrix?

  • Posts: 2,161

    Some objects, such as meshes, can use a 3d coordinate system internally. When rendered onto the screen, this has to be projected to a 2d system. The matrix is one step in that projection that allows you considerable freedom as to how that projection is done. My roller coaster in the example project works by manipulating the matrix: the planks are actually stationary the movement all comes from changing how they are projected onto the screen.

  • Posts: 49

    I don't understand clear, You can give me a example of a code that us a matrix?

  • Posts: 2,161

    In the example projects there is one called "Roller Coaster". That uses matrix manipulation.

  • Posts: 49

    Ok Thanks :)

  • Posts: 10

    A matrix is essentialy a 2D array, with the exception that it only holds numerical values (remember, Lua arrays can hold anything, including other arrays!). What's neat about matrices is that you can operate on them in some pretty neat ways, making 3D much easier to deal with.

    Here's a really awesome link which gives you a good introduction to what matrices are and what to use them for: http://stackoverflow.com/questions/487352/learning-game-programming-part-2-math

  • Posts: 179

    Check out this tutorial, it is written about another programming language called processing, but it is very similar to Codea. Most of what you want to know is here:

    http://processing.org/learning/transform2d/

Sign In or Register to comment.