Domanda

I've just started graphics programming in Ogre, and just can't understand why there is a separate viewing frustum class and a separate camera class.
In the real world, every camera has its own viewing frustum. Shouldn't the properties of the viewing frustum be present in the camera class?

Is there any advantage in having them separate? I just don't see the point.

È stato utile?

Soluzione

It's called separation of concerns. Basically a class should do one thing and one thing only.

Altri suggerimenti

Isn't it that the Camera inherits FROM Frustum and not the opposite? Frustum is just a pyramid located in space and can be used for many things, like Spotlights, shadows computation, visibility, etc.

Camera is a Frustum with additional Camera Events handling, yaw/pitch/roll methods, render mode/LOD settings, visibility checks and so on...

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top