A comment on a piece of code in the book

Source: Internet
Author: User

Taken from Focus on 3D Terrain programming:
//--------------------------------------------------------------//name:cterrain::filterheightband-private//description:apply The erosion filter to an individual//Band of height values//Arguments:-fpband:the band to be filtered//-istride:how far to advance per pass//-icount:number of passes to make//-ffilter:the Filter Strength//Return Value:none//--------------------------------------------------------------voidCterrain::filterheightband (float* Fpband,intIstride,intICount,floatffilter) {  floatv= fpband[0]; intj =Istride; inti; //go through (traverse) the height band and apply the erosion filter   for(i=0; i<icount-1; i++) {Fpband[j]= Ffilter*v + (1-ffilter) *Fpband[j]; V=Fpband[j]; J+=Istride; }}
Filter a piece of code, where Istride is the step, ffilter is the coefficient, for this, you can change the function parameter name to the following name seems to be more descriptive function function: void Filterheightband (float* fpband,int istep,int Icount,float ffilterfactor)

A comment on a piece of code in the book

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.