tailieunhanh - Multi-Threaded Game Engine Design phần 8

Chức năng mới này, kết hợp với mã vector hiện tại của chúng tôi, sẽ sản xuất một động cơ, ma cao có thể sử dụng thực sự mạnh mẽ. Không chỉ đơn thuần cho các trò chơi 2D, một công cụ ma được sử dụng khá thường xuyên để làm cho hạt và phông chữ bitmap-hai | Simpo PDF Merge and Split Unregistered Version - http This page intentionally left blank Simpo PDF Merge and Split Unregistered Version - http CHAPTeR 14 Sprite Animation AND Rasterization This chapter covers the subject of sprite animation. We will learn how to render sprites with 2D transformation matrices with full support for translation rotation and scaling. That process is called rasterization which describes the rendering of an object onto a 2D screen. Technically the video card rasterizes all rendered output based on our projection matrix settings. But in the context of this chapter sprite rasterization is an appropriate term because ID3DXSprite renders rectangular shapes using orthogonal projection. This new functionality combined with our existing vector code will produce a truly robust highly usable sprite engine. Not merely for 2D games a sprite engine is used quite often to render particles and bitmapped fonts two supplemental topics covered later in the chapter. There are two ways to render 2D objects in Direct3D. First you can create a quad or rectangle comprised of two triangles with a texture representing the 2D image you wish to draw. This technique works and even supports transparency responds to lighting and can be moved in the Z direction. The second method available in Direct3D for rendering 2D objects is with sprites and this is the method we will focus on in this chapter. A sprite is a 2D representation of a game entity that usually must interact with the player in some way. A tree or rock might be rendered in 2D and interact with the player by simply getting in the way stopping the player by way of collision physics. We must also deal with game characters that interact with the player s character whether it s an arrow fired from a bow or a missile fired from a spaceship. 401 402 SimporPDF MergesandSplit Uni-egistei-ecaVei-sion - http This chapter will cover the following Sprite .

TỪ KHÓA LIÊN QUAN