Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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.

share|improve this question
1  
Are you sure you're using a perspective viewport instead of a orthogonal one? –  Gustavo Maciel Jan 16 '12 at 9:08
1  
What game engine is it, and what is your question, exactly? –  Trevor Powell Jan 16 '12 at 10:05
2  
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. –  Bobby Jan 16 '12 at 11:23
1  
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. –  Bobby Jan 16 '12 at 11:41
2  
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. –  jhocking Jan 16 '12 at 16:50
show 4 more comments

1 Answer

up vote 3 down vote accepted

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.

share|improve this answer
1  
+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. –  Nic Foster Jan 16 '12 at 15:39
    
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. –  Jarvis Jan 17 '12 at 4:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.