1
\$\begingroup\$

I'm using a 3D game engine, that uses a 4x4 matrix to modify the camera projection, in this format:

 r r r  x
 r r r  y
 r r r  z
 - - -  zoom

Strangely though, the camera does not respond to the Z translation parameter, and so you're forced to use X, Y, Zoom to move the camera around. Technically this is plausible for isometric-style games such as Age Of Empires III. But this is a 3D engine, and so why would they have designed the camera to ignore Z and respond only to zoom? Am I missing something here? I've tried every method of setting the camera and it really seems to ignore Z.

So currently I have to resort to moving the main object in the scene graph instead of moving the camera in relation to the objects.

My question: Do you have any idea why the engine would use such a scheme? Is it common? Why? Or does it seem like I'm missing something and the SetProjection(Matrix) function is broken and somehow ignores the Z translation in the matrix? (unlikely, but possible) Anyhow, what are the workarounds? Is moving objects around the only way?

Edit: I'm sorry I cannot reveal much about the engine because we're in a binding contract. It's a locally developed engine (Australia) written in managed C# used for data visualizations.

Edit: The default mode of the engine is orthographic, although I've switched it into perspective mode. Its probably more effective to use X, Y, Zoom in orthographic mode, but I need to use perspective mode to render everyday objects as well.

\$\endgroup\$
9
  • 1
    \$\begingroup\$ Are you sure you're using a perspective viewport instead of a orthogonal one? \$\endgroup\$ Jan 16, 2012 at 9:08
  • 1
    \$\begingroup\$ What game engine is it, and what is your question, exactly? \$\endgroup\$ Jan 16, 2012 at 10:05
  • 2
    \$\begingroup\$ I'm sorry I cannot reveal much about the engine because we're in a binding contract. If you have a contract with the creators/suppliers of that engine, go ask them. \$\endgroup\$
    – Bobby
    Jan 16, 2012 at 11:23
  • 1
    \$\begingroup\$ I don't know anything about your business/employer, but that sounds like it should go to someone who can make decisions, something along the lines "we've problem with the engine and $contractor refuses to help, what are we supposed to do?". Also, without knowing anything about the engine, we'll hardly able to help...after all this could also be bug of some sort. \$\endgroup\$
    – Bobby
    Jan 16, 2012 at 11:41
  • 2
    \$\begingroup\$ If that's what you wanted then you should have asked that. No it's not common but that is a false dichotomy; just because something isn't common doesn't make it a fault. \$\endgroup\$
    – jhocking
    Jan 16, 2012 at 16:50

1 Answer 1

3
\$\begingroup\$

You do not mention a view matrix which is usually used for camera position & rotation while the projection matrix is used for zoom(FOV) & frustum params.

Although these two get combined in the end into a final "camera" matrix to render the object, I've not seen an engine where you have to maneuver the combined result... You always maneuver the view matrix only then re-combine (multiply) it with the projection matrix.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ +1. The projection matrix probably isn't what you should be altering if you're moving the camera around, the view matrix will include position and rotation information about the camera, so you'll want to use that. Generally if you're working with an existing engine you won't have to manually alter the view matrix, you will usually have positioning and rotation, or look-at methods that you can use that will apply changes to the view matrix for you. Long story short, if you're contracted to work with this company and use their engine, they should be supplying you with basic functionality. \$\endgroup\$
    – Nic Foster
    Jan 16, 2012 at 15:39
  • \$\begingroup\$ I think the view matrix is referred to as the "projection matrix" which is why I started using the term. The FOV matrix is another internally modified matrix. This matrix that I'm referring to modifies camera rotation and position, except that you get only X/Y, not Z, and you have to manage with Zoom instead. \$\endgroup\$ Jan 17, 2012 at 4:43

You must log in to answer this question.

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