Focus on 3D terrain programming learning points

Source: Internet
Author: User

Although the version of the Dragon is not good, but retains the original, read the book when the best combination of the original and the Dragon's translation. In addition, if there has been experience in terrain generation to read this book some help, this book introduces the professional outdoor terrain development, very comprehensive introduction.

Only a personal summary, may not be suitable for netizens to read.

Using fault formation and midpoint displacement to generate irregular terrain (program generation height map) burte force (hard rendering) is the slowest terrain rendering algorithm, and if it is a 5*5 height map, then 5*5 vertices will be generated, fault Formation+burte Force algorithm +/-Terrain generation algorithm + terrain rendering algorithm height graph using unsigned char array storage; You can actually use floating-point numbers temporarily (such as fault formation and midpoint Displacement algorithm), such as this terrain generation algorithm with a floating-point representation of the height is more accurate. After the height map is created and normalized, it is passed into the height graph array unsigned char. Each pixel in the height map is a grayscale value, a dark color represents a low-lying, a light is a bulge, and a program dynamically generates a height map. Use raw as the purpose of the height map: only contains pure data, easy to load. Fault formation (program-generated height map) can produce relatively smooth terrain fault formation is broadly divided into two stages 1. Generate height Figure 2. Filtering because the algorithm features are different, fault formation does not necessarily generate a height map for all scenarios, So there is the midpoint displacement algorithm, but also two stages, but the height graph generation algorithm is different, the filtering algorithm is the same.

Focus on 3D terrain programming learning points

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.