# How should I organize my matrices in a 3D game engine?

I'm working with a group of people from around the world to create a game engine (and hopefully a game with it) within the next upcoming years. My first task is to write a camera class for the engine to use in order to add cameras to the scene, with position and follow points.

The problem I have is with using matrices for transformations in the class, should I keep matrices separate to each class? Such as have the model matrix in the model class, camera matrix in the camera class, or have all matrices placed in one class/chuck? I could see pros and cons for each method, but I wanted to hear some input form a more professional standpoint.

• well camera should have view and projection matrix and something that has a model on it should have world matrix – Kikaimaru Nov 24 '12 at 23:51
• I wonder what would be the pros of shoving everything in the same class. – Laurent Couvidou Nov 28 '12 at 16:51

Have a matrix class that can be utilized by all the other classes. There's no point in duplicating code. You want to keep that to a minimum.