My experience on triangle Binary Tree terrain with levels of levels

Source: Internet
Author: User

 

I recently studied 3D terrain, so I wanted to create a level of detail. There are two types of SLS: bottom-up (bottom-up) and top-down (top-down ). From the bottom up, we start from the complete model and simplify it step by step. We constantly improve a Complete Binary Tree and finally reach the top with two triangles. This method can be referred to the hopssive mesh of the memory PE, but I have never tried this method. If a tree is constructed in the memory beforehand, the memory is too expensive. If it is dynamically created, it is too slow to crop the complete model and make the dump. Therefore, this method is not suitable for the terrain with the level of detail (in my opinion ). Let's talk about the top-down method, which is to gradually refine the initial square and build a tree. The most popular are the Quadtree and binary tree. I want to create a binary tree first.

From the very beginning, the shortest mesh begins with the dump, which is two triangles.

 

 

 

 

 

In this case, divide the two triangles into two halves. Become:

 


When splitting, You can crop the two triangles. Common cropping methods include back-to-face cropping, hidden surface cropping, and distance-to-Nearest-level slice adjustment. This does not fall into the scope of this article. In this way, the triangle can be divided recursively until no triangle can be divided.

Because this partitioning method is relatively regular, this type of SLD does not need to create a tree, and two subtriangles of each triangle can be calculated according to the regular pattern. See the figure below:

 

 

 

 

 

 


The above is the parent triangle. If split, the New Triangle will be generated:

 

 


If the three vertex indexes of the parent triangle are ver1, ver2, and ver3, the indexes of the two subtriangles are:

(Ver2 + ver3)/2, ver1, ver2 and (ver2 + ver3)/2, ver2, ver0. Therefore, you can traverse a Complete Binary Tree perfectly without any method. The implementation of this method can be recursive or queue-oriented.

If you follow this method, you will find a problem, that is, there will be cracks. People who have done the level-4 terrain know how annoying T-Shaped Cracks are. So I spent two days working out a way to fix the cracks without the topological relationship between triangles. That is to say, I don't have to store its adjacent triangles or vertices for any triangle. Therefore, it saves some memory. In the next article, we will introduce the methods.

 

 

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.