Download fulltext

Transcript
profile and version to be used and the xmlns attribute defines the X3D namespace. The
<head> tag is optional and can be used to include Meta data (meta tags). The
<Scene> tag is where we can start to define the properties of the scene including the
shapes, and it should be ended with close tag </Scene>. The <Background> tag can
specify the background sky color used, in the example above it is white as the colors in
X3D should be defined as RGB values which has three floating point values between (0
and 1) separated by white spaces. The <Viewpoint> tag determines where the camera
should be placed and the viewing angle.
The <Shape> tag determine that we are about to define a shape in the scene which is
a <Sphere/> tag that is closed straight away and then the <Appearance> tag specify
how the Sphere should be displayed (in the above example we specified a <Material/>
tag to be used for drawing the Sphere). Then the closing tags for both the
<Appearance/> tag and the <Shape/> tag.
The (.x3d) file above should be embedded into an html page to be displayed (the .x3d
file can be opened by its own if there is a program specified with such extension). The
html page should embed the (.x3d) file as object.
For example if we assume that we have an X3D file with the name (hello.x3d) we can
embed it into an html page as below:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title> TITLE OF THE HTML DOCUMENT </title>
</head>
<body>
<object data="hello.x3d" type="model/x3d+xml" height="600" width="800">
<param name="src" value="hello.x3d"/>
</body>
</html>
Take note that the object tag also specifies the height and width of the object inside
the html page.
16