Fractal-C-line

Source: Internet
Author: User

As mentioned above, the levy curve is generated by dividing a line segment into two lines with the same length and vertical lines. in addition, the fragtal dragon is also to turn a line segment into two lines with an angle of 90 degrees. this section shows that a line segment is constantly divided into two equal-length and non-fixed-angle line segments to generate a graph. this is like turning a line segment into an isosceles triangle. The original line segment is the bottom side of an isosceles triangle, and the new line segment is the waist side of an isosceles triangle. change the fragment graph by setting the angle of the bottom corner.

Core code:

static void FractalAngleC(const Vector3& vStart, const Vector3& vEnd, Vector3* pVertices, Yreal angle){    Vector3 vSub = vEnd - vStart;    pVertices[0] = vStart;    pVertices[2] = vEnd;    Yreal alfa = atan2f(vSub.y, vSub.x);    alfa += angle;    Yreal l = D3DXVec3Length(&vSub)*0.5f/cosf(angle);    pVertices[1].x = vStart.x + cosf(alfa)*l;    pVertices[1].y = vStart.y + sinf(alfa)*l;    pVertices[1].z = 0.0f;}

Software: http://files.cnblogs.com/WhyEngine/Fractal.7z

Fractal-C-line

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.