[X3DOM Demo] Create geometry by using JavaScript

1. Prepare your HTML file.
Don’t forget to link your HTML file with x3dom.js and spheretroupe.js or your JS file.

SphereTroupe: Link to JS files.

You also can link X3DOM JavaScript from this link: http://x3dom.org/x3dom/src/x3dom.js

Write your X3D Tag in body tag in your HTML file

SphereTroupe: X3D Tag in HTML file

2. Create your JavaScript file and write your function in this file.

SphereTroupe: spheretroupe.js

You can write X3D in document.write(“”); same as using createVrmlFromString in VRML if your ever seen it. But in X3DOM it’s easier, See SphereInit function.

Result of SphereTroupe Demo
– Default View

SphereTroupe: Default view

– Perspective View

SphereTroupe: Perspective view

– Point Mode in Perspective View (by type “m” on your keyboard)

SphereTroupe: Points Mode in Perspective View
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s