X3d Lectures on the basics of actual combat seven

Source: Internet
Author: User

Seventh lecture light Source processing

In the x3d scene space, the illumination brightness of the Shape object can be treated by point Light node (pointlight), Parallel source node (directionallight) and concentrating light source node (SpotLight).

This explains the properties of these three nodes and how to use them.

One, point Light source node (pointlight)

Pointlight is a point light that emits light in all directions. Light illuminates all geometrical objects and is not shaded by geometric forms. Its main properties are shown in the following table:

tr>
properties meaning default value use instructions
on light switch true
color 1 1 1 Specifies the color of the light that affects the actual color display effect of the object
Where the light source is located 0 0 0 /tr>
intensity lighting brightness 1
ambientintensity 0
radius Light impact radius 100 maximum radius of lighting effect with light source
light attenuation parameter 1 0 0

The simple sample code is as follows:

Description: We first construct a small ball with the same color as the light source at the point light position, then construct a cylinder at (3,0,0). The results are shown in the following figure, noting the color of the cylinder.

If an identical cylinder is added between the light source and the cylinder, try to compare the effects of the two cylinders. The code is as follows:

The results are shown in the following illustration:

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.