X3d 12 of the basic practical lectures

Source: Internet
Author: User

In X3d, the script is embedded by using a programmatic node script. It supports Ecmascript/javascript or the Java language. Here's an explanation of what a ecmascript,ecmascript is also a scripting language, developed using Netscape and Microsoft, and is an object-oriented language, ECMAScript and Dom are very close to the current implementation of JavaScript and JScript, although they are used in a network environment, but they can be used in any scripting environment, and their syntax is essentially the same as JavaScript.

In this talk, let's take a look at an instance process and then explain its simple programming approach.

De jure an instance procedure that embeds a script

This example is when the mouse clicks on the cylinder, the cylinder moves out of the ball it is connected to, and then the cylinder is clicked, and the cylinder returns to its original position. The sample process is as follows:

(1) Create a 12. X3d the new document with the following initialization procedure:

(2) because the ball does not need to move, so we first construct a ball, the color is yellow. As in the following code:

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.