Game Engine Design:
In designing the engine, the first thing we need to do is to design the entire engine frame.
The 3D game engine is divided into 3 parts: core underlying algorithms, engine engines, game games. Engine architecture design is mainly divided into core and engine
Core as the lowest-level package, also provides the logic to write interfaces externally
Its main functions are: Custom type design, visual body package (processing camera clipping, within the camera range is visible, outside the camera content to be clipped off), game lighting Design
Engine as an interface for game logic to write game logic calls, and its implementation features include camera encapsulation in the game scene
The camera class implemented at the engine layer will invoke the Encore layer's view body interface to achieve the cropping function.
Graphic drawing function interface is mainly used to draw objects in the game scene
Input interface handles game and user interaction
The Game object class is the parent of all object objects in the scene
The specific object classes implemented at the logical level are required to inherit the class
The game window is defined within the engine,
Meaning of GDI
GDI is the Graphicsdeviceinterface graphics device interface. It is responsible for exchanging information between the system and the drawing program.
Process all Windows program graphics output
Engine Rendering Ideas:
(1) Convert the object's world coordinates to camera coordinates
(2) Convert from camera coordinates to perspective coordinates
(3) Transform from perspective coordinate to graph coordinate
The pipeline is as follows:
Local coordinates to world coordinate conversion--object culling--insert render list, back-to-bottom-off render lists, world coordinates to camera coordinate transformation render list, camera coordinates to perspective coordinates
--Pivot coordinates to screen coordinates--draw a list of renderings