I am having a bit of trouble understanding how these matrixes work and how to set them up in relation to one another to get a proper system running.

In my understanding the Model Matrix is the matrix of a object, for example a cube or a sphere, there will be many of these in the application/game.

The World Matrix is the matrix which defines the origin of the 3D world. the starting point.

And the View Matrix is the "camera" everything gets translated with this to make sure you have the illusion of an actual camera when in fact everything is moving instead of this matrix?

I am a bit lost here. So I was hoping someone here could help me understand this properly.

Does every modelMatrix get translated/multiplied with the world matrix and the worldMatrix then with the viewMatrix? Or does every modelMatrix get translated/multiplied with the viewMatrix and then that with the worldMatrix?

How do all these matrixes relate and how do you set up a world with multiple objects and a "camera"?


Thanks a lot for the feedback already. I did some googling aswel and I think I do understand it a bit better now, however would it be possible to get some pseudo code advice?

projectionMatrix = Matrix;
makePerspective(45, width, height, 0.1, 1000.0, projectionMatrix);

modelMatrix = Matrix;
translate(modelMatrix, [0.0, 0.0, -10.0]);  // move back 10 on z axis

viewMatrix = Matrix;
// do some translation based on input with viewMatrix;

Do I multiply or translate the viewMatrix with the modelMatrix or the other way around? and what then? I currently have a draw method up in such a way that it only needs 2 matrixes for arguments to draw.

Here is my draw method:

draw(matrix1 matrix2) {

            bindBuffer(ARRAY_BUFFER, cubeVertexPositionBuffer);
            vertexAttribPointer(shaderProgram.getShaderProgram().vertexPositionAttribute, cubeVertexPositionBuffer.itemSize, FLOAT, false, 0, 0);

            bindBuffer(ARRAY_BUFFER, cubeVertexColorBuffer);
            vertexAttribPointer(shaderProgram.getShaderProgram().vertexColorAttribute, cubeVertexColorBuffer.itemSize, FLOAT, false, 0, 0);

            bindBuffer(ELEMENT_ARRAY_BUFFER, cubeVertexIndexBuffer);

            setMatrixUniforms(shaderProgram, matrix1, matrix2);

            drawElements(TRIANGLES, cubeVertexIndexBuffer.numItems, UNSIGNED_SHORT, 0);


What are those matrixes suppose to be? Thanks a lot in advance again guys.

  • 1
    \$\begingroup\$ Do you know what matrix is? Do you know how to multiply matrices / vectors? Do you know, what matrix represents (linear / affine transformations) ? If you don't, you better start with some Math first. \$\endgroup\$ Commented May 26, 2013 at 15:12
  • \$\begingroup\$ Probably a good idea to focus on that. any idea what to search for or any good sources you know of online? \$\endgroup\$
    – Sam
    Commented May 26, 2013 at 16:50
  • 1
    \$\begingroup\$ Work your way up to linear algebra, then look for basic 3D rendering and then tutorials. The intertubes is full of good sources but you have to take it one step at a time or, as you've noticed, you get totally lost. \$\endgroup\$ Commented May 26, 2013 at 17:56

2 Answers 2


Within a 3D rendered scene, there are typically three main matrices used to transform an object from its own local space (object/model space) to a homogeneous space known as screen space.


  • The World matrix being the first, is unique for every object within your world, and is responsible for transforming the vertices of an object from its own local space, to a common coordinate system called world space.


  • After that, the view matrix provides the concept of a mobile camera, when it reality the camera is actually the only constant point of reference within the world. The view matrix is a transformation that is applied to every object in the scene (but is not unique to each object), and provides the illusion of a camera. The view matrix is basically the inverse of what could be considered a world matrix for the camera. Yet instead of moving the camera itself, it provides the opposite movements to the rest of the scene (the illusion ;) ).


  • Finally the projection matrix is responsible for converting a 3D world into the homogeneous screen space that you see on your screen. This is the matrix used to represent your view frustum, and is usually represented as an orthographic or perspective projection.

At the simplest level, every one of your objects needs to contain its own world matrix, your "scene" or whichever context you use must contain a view matrix to represent a camera, and a projection matrix to convert world coordinates to screen coordinates. All of these then need to be passed to the vertex shader (with the world matrix changing for each object, but not necessarily the view or projection) to be transformed.

  • \$\begingroup\$ I updated my post, could you perhaps help out with the pseudo code I wrote down to help me understand the answer better? \$\endgroup\$
    – Sam
    Commented May 26, 2013 at 18:10
  • \$\begingroup\$ Can I take the exact text of this answer without creating any copyright infringement ? \$\endgroup\$
    – anonymous
    Commented Aug 2, 2016 at 8:08
  • 1
    \$\begingroup\$ Yes, you can use it \$\endgroup\$
    – Evan
    Commented Aug 2, 2016 at 13:46
  • \$\begingroup\$ Shouldn't the "World" matrix be called the "Model" Matrix, and the combination of Model and View, the "ModelView" matrix, be the "World" matrix? \$\endgroup\$
    – BAR
    Commented Aug 21, 2016 at 6:52
  • \$\begingroup\$ The exact terminology may vary depending on the code base being used. Some rendering pipelines combine certain matrices, while others leave them split. I have seen some systems use the terminology that you describe here. \$\endgroup\$
    – Evan
    Commented Aug 22, 2016 at 14:42

Good answer is here https://stackoverflow.com/questions/6461740/xna-worldmatrix-and-viewmatrix

First of all, there is no real difference between a "World Matrix" and a "View Matrix", they are both transformation matrices and the distinction is somewhat arbitrary. Some systems even combine the two (OpenGL simply has a "ModelView" matrix).

Traditionally the "world matrix" is used to move individual models from "model space" to "world space". Then the "view matrix" is used to move all the models from world space into their relative positions in front of the camera (which, in effect, "moves the camera"). And finally the "Projection Matrix" converts the 3D positions into their 2D positions on the screen (generally with a perspective projection). Because they are matrices, they can be multiplied together into a single matrix that can transform points in a single step.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .