Does my thoughts make sense?

Hi,

I am currently trying to create some libraries making the life easier with MonoGame. I know there is MonoGame.Extended and thats totally fine, but as I am actually a very Newbie to Game Development and Math at Game Development-Level I want to understand what is going on in behind of all this. So I am creating my own libaries where I can understand how to do things and stuff.

But now I am not entirely sure how things are good to do and how things are not good to do… Additionally I am new to matrices, transforms, and all that stuff.

I know a Transform is a translation, rotation and scalation so that is easy and I know how to make a TransformMatrix out of those but how do i properly use those matrices.

For example, in my game i want a camera which has a transform. But i also implemented an entity component system where entities get a TransformComponent which also contains Translation, rotation and scalation.

Now I thought, when i have functions like Move / Rotate / Zoom in the camera, how would they be applied on the entities which has its own transform matrix.

Is it okay to simply add camera transform + entity transform? Basically this means, every entity has to add its transform to the camera transform to have functionality like zoom , scale or rotate by using the camera right?

The system behind that, is it okay to do it like that?

Maybe you can share some thoughts how you would realize that. My aim are simply 2d platformer games nothing more.

Thanks

Short answer yes.

Correction though you multiply each game object / entity with the view and projection matrix.

In 2d spritebatch can do this for you by passing it a matrix or you can just do it yourself and translate all your objects in a loop to the cameras -scroll position. 2D is simpler then 3d because you don’t have to worry about the x and y axis rotations. But all the same operations and steps apply to each object. With maybe the exception of what type of projection matrix you choose.

You orient objects in world space, the camera transforms them all to view space, with a view matrix. Now you see all your objects from the cameras point of view.

1 Like

Allright, thanks then I think I am on the right way.