External Resources

Inline • Attributes

Four basic colored boxes lined up in a row. The scene was loaded from an external X3D file.

Inlining allows you to reuse shapes in multiple scenes. It also allows you to break up and organize extra long X3D files.

 

Rotate the vrignette to view the geometry.

<!----- X3D Code Example File ----->
<x3d>

<scene>

<worldInfo title="X3D Inline Example">
</worldInfo>

<navigationInfo headlight="true">
</navigationInfo>

<viewpoint position="0.0 0.0 25.0" centerOfRotation="0.0 0.0 0.0">
</viewpoint>

<transform rotation="1 0 0 0.392">
<transform rotation="0 1 0 0.392">
<inline url="inline_example.x3d">
</inline>
</transform>
</transform>

<background skyColor="0.20 0.20 0.20" groundColor="0.20 0.20 0.20">
</background>

</scene>
</x3d>

<!----- Inline Example Resource File ----->

<x3d>
<scene>

<transform translation="-6.0 0.0 0.0">
<shape>
<appearance>
<material diffuseColor="1.0 0.5 0.5">
</material>
</appearance>
<box size="3.0 3.0 3.0" solid="true">
</box>
</shape>
</transform>

<transform translation="-2.0 0.0 0.0">
<shape>
<appearance>
<material diffuseColor="0.5 1.0 0.5">
</material>
</appearance>
<box size="3.0 3.0 3.0" solid="true">
</box>
</shape>
</transform>

<transform translation="2.0 0.0 0.0">
<shape>
<appearance>
<material diffuseColor="0.5 0.5 1.0">
</material>
</appearance>
<box size="3.0 3.0 3.0" solid="true">
</box>
</shape>
</transform>

<transform translation="6.0 0.0 0.0">
<shape>
<appearance>
<material diffuseColor="0.5 0.0 0.5">
</material>
</appearance>
<box size="3.0 3.0 3.0" solid="true">
</box>
</shape>
</transform>

</scene>

</x3d>