The first 3DS image rendered by ferryman Fractal

Source: Internet
Author: User

Any object in a ray tracing scenario can be rendered only by the intersection algorithm and the normal algorithm.

Virtual int intersect (const ray & ray, float & distance) = 0;
Virtual vector3 getnormal (vector3 & Pos) = 0;

To adapt to the rendering of the triangle band, the data structure of the triangle is defined:

Vector3 vertex [3];
Vector3 normal [3];

Because pasters are not yet supported, the ray tracing plug-in only processes vertex data (0x4110) and surface data (0x4120) when reading the 3DS file ). At present, the normal is calculated based on the surface of the triangle, and the influence of the adjacent triangle is not considered. Therefore, the rendered image looks very stiff. The next step is to re-calculate the normal data of the three vertices and optimize the speed.

 

This article is originally created by span Zhang (Zhang youbang). For more information, see the source.

The first stop of Chinese original Fragment Art and Chinese original fragment Software

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.