three.js-002

Source: Internet
Author: User

Threejs three component scenarios (scene), Camera, and renderer (renderer).

With these 3 components, objects can be rendered to a Web page.

1.scene-----containers for all items

In the Threejs scene is only one, with Three.scene to represent, to build a scene is also very simple, as long as the new object can be, the code is as follows:

var scene = new three. Scene ();

The scene is a container for all objects, and if you want to display an apple, you need to add the Apple object to the scene.

2.camera----Observing the object's perspective

The camera determines the view of that angle in the scene to be displayed. The camera is like a human eye, people stand in different positions, looking up or down to see different views.

There is only one scene, but there are many different cameras. As in reality, different cameras identify all aspects of the phase. For example, some cameras are suitable for portraits, some cameras are suitable for landscapes, and professional photographers choose different cameras depending on the actual use. For programmers, just setting different camera parameters can make the camera look differently.

There are a variety of cameras in Threejs, two of which are:

Perspective Camera (Three.perspectivecamera)

3.renderer----Draw where, how the way

The renderer determines what elements of the render should be drawn on the page, and in what way.

three.js-002

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.