3D games from getting started to mastering -24_ games

Source: Internet
Author: User
What is the texture's use texture? In the game, but also what kind of role. There must be a lot of questions in your mind. In the world we live in, rich and colorful environment, if all use real-time rendering, it is certainly very time-consuming, and the current computer, still cannot reach this level. Since the computer's limited computational power, but also want to show a rich and colorful world, then have to use texture. For example, to display a house marble floor, you can directly use the marble picture, to the ground a paste, like a real marble. The texture enhances the authenticity of the generated image, and presents a rich and bright wind environment.   In our furniture, because we like the furniture with wood grain, as a result of the lack of wood, many places are used composite board, this plate and no wood grain, so the manufacturer uses the method of mapping, the processing of wood plate to do a good job on the furniture on a stick, like a real plank. Texture coordinates provide a lot of management texture functions in the D3D, and it is easy to use textures. Before you use textures, understand what textures are. How the texture is applied to the triangle above it. In D3D, texture images are used at pixel points. Since the texture picture is two-dimensional, you can use a two-dimensional coordinate system to represent each pixel point position. This two-dimensional coordinate system is the same as the coordinate system of the screen, which is the origin of the coordinates in the upper-left corner, the direction of the U-axis in the right, and the direction of the V axis from the origin. Regardless of the size of the texture, the coordinate values of all the texture elements in the coordinate system are from 0 to 1. That is, the value of U and V is between 0 and 1. For example, set the texture coordinate value (u,v) for the vertex (0.5,1.0), when the different size of the image as a texture, this vertex uses the texture element is not the same. If the picture is the size of a 4x4 texture picture, then it uses the texture element to be (2,4) the pixel. If the picture is a 6x6 texture, it uses a texture element that is (3,6) pixels.       It says that the texture coordinates are usually between 0 and 1.0, but in the D3D the special effect, or can make the texture coordinate value of more than 1.0. This ebook, Mm3d engine source program, example source program a total of 49 yuan a set of contacts: Cai Jun Health Contact: qq:9073204 email:caimouse1976 at Sina.com

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.