TAILIEUCHUNG - Beginning XNA 2.0 Game Programming From Novice to Professional phần 8

Cuối cùng, bạn cấu hình các tài liệu địa hình và các kết cấu thông qua các thuộc tính LightMaterial và TextureMaterial của các lớp TerrainMaterial. Sau đây là mã cho phương pháp SetEffectMaterial:Sử dụng container dịch vụ bạn có thể nhận được người quản lý máy ảnh (CameraManager) | CHAPTER 10 GENERATING A TERRAIN 289 Using the service container you can get the camera manager CameraManager and obtain the active camera from it and you can read the terrain transformation from its transformation attribute of type Transformation Get the camera manager cameraManager typeof CameraManager as CameraManager Set the camera view and projection Set the terrain transformation Finally you configure the terrain material and the textures through the LightMaterial and TextureMaterial attributes of the TerrainMaterial classes. Following is the code for the SetEffectMaterial method private void SetEffectMaterial Get the light manager LightManager lightManager typeof LightManager as LightManager Get the first two lights from the light manager PointLight light0 lightManager 0 as PointLight PointLight light1 lightManager 1 as PointLight Lights Get the camera manager cameraManager typeof CameraManager as CameraManager Set the camera view and projection 290 CHAPTER 10 GENERATING A TERRAIN Set the terrain transformation Material Textures .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.