Focus On 3D Terrain Programming phần 6

Điều quan trọng cần lưu ý rằng các thuật toán chuyển điểm giữa có một nhược điểm nhỏ: Các thuật toán chỉ có thể tạo ra heightmaps hình vuông, và Kiểm tra hình cụt của chúng tôi là điều tương tự như Chương 5. Chúng tôi sẽ tạo ra một "khối lập phương" của nút hiện tại và sau đó kiểm tra nó chống lại các khung nhìn. | multistory robots that are capable of mass destruction. Geomorphing is actually the process of gradually morphing vertices in a set of polygons like our geomipmapping patch that are changing their level of detail. I personally think the mech thing sounded like more fun but the actual meaning of geomorphing is far more useful. Why is this useful you ask It is quite simple actually. You see when a patch is of a low level of detail it approximates the heights of several areas see Figure . And in the figure areas where the patch is approximating values are marked with a black dot. Figure How a lower-level patch approximates height values for several vertices of the lower level patch. You see how many black dots are on the lower patch in the image Well that s how many height values are being approximated by the lower-detailed patch. The approximate values are close to the real value but not close enough. Therefore when the level 3 patch subdivides into the level 2 patch or vice-versa popping occurs that s because those approximated values are being replaced by the true values or the true values are being replaced by the approximated values . Geomorphing fixes this problem by figuring out how far off the approximated value is from the true value and interpolating it from the approximated value to the true value over a series of about 255 steps. Or vice versa. again. Okay from here on out I m going to assume that we re subdividing the patch. If you re merging a patch just reverse all of the calculations. To calculate the number of units you need to move every step just use this equation _ to-from 9eo numSteps Figure Equation to calculate the geomorphing value. In the equation to is the real value that you are going to from is the approximate value that you are going from and numSteps is the number of steps you want for the geomorphing to take place which I suggested to be 255. This whole process is explained visually in Figure . Figure .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
Đã 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.