TAILIEUCHUNG - 3D Graphics with OpenGL ES and M3G- P37

3D Graphics with OpenGL ES and M3G- P37:Mobile phones are the new vehicle for bringing interactive graphics technologies to consumers. Graphics that in the 1980s was only seen in industrial flight simulators and at the turn of the millennium in desktop PCs and game consoles is now in the hands of billions of people. This book is about the technology underpinnings of mobile threedimensional graphics, the newest and most rapidly advancing area of computer graphics. | 344 LOW-LEVEL MODELING IN M3G CHAPTER 14 If you want to use a background image you will need the following methods in Background void setImage Image2D image void setImageMode int modeX int modeY void setCrop int cropX int cropY int width int height Only RGB and RGBA formats are allowed for a background image and the format must match that of the rendering target. In other words you can use an RGBA format background image only when rendering into an M3G Image2D that has an alpha channel RGB is the only allowed format for MIDP rendering targets as Canvas and mutable Image objects never have an alpha channel. This restriction was incorporated to save software M3G implementations from having to implement dedicated blitting functions for each combination of formats. However implementations today typically rely on OpenGL ES texturing for drawing background images making the restriction completely unnecessary if you wish you can also easily implement your background as a textured quad a skybox or any other suitable geometry and side-step the whole issue. The size and position of the background image is controlled with setCrop int cropX int cropY int width int height . The point cropX cropY in the image is placed in the top left corner of the viewport with the width by height pixels to the right and down from there scaled to fill the viewport. The setImageMode function controls whether the background image should be tiled or not separately in either direction. Specifying BORDER fills areas outside of the image with the specified background color whereas REPEAT tiles the image ad infinitum. The tiling modes can be different for X and Y directions. Example scrolling background Pulling all this together let us clear our QVGA screen so that the background image resides at the top of the screen and is scrolled in the horizontal direction while the area below the image is cleared with a light green color and later filled by rendering some 3D content. The code to do that is shown

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.