Pinecoast
 
Basic
Handbag
Cell Phone
Watch
 
Basic 3D Geometry
Messaging
Background
Butterflies
Fog
Color Interpolator
3D Shapes
2D Shapes
Textures
Material
IndexedFaceSet
Layering
Overlay
Shaders 1
Shaders 2
 
     


Tutorial: Basic 2D Shapes

The 2D shapes are all restricted to the xy plane. These shapes were introduced in version 3.0, and so cannot be used in Vrml97 files. If these shapes are used in the Immersive profile, it is necessary to specify the Geometry2D component. In classic Vrml format, ...

#X3D V3.0 utf8
PROFILE Immersive

COMPONENT Geometry2D:2
...

In X3D format, ...

<X3D profile="Immersive" version="3.0">
  <head>
    <component name="Geometry2D" level="2"/>
  </head>
  ...

Arc2D and Circle

A circle is specified simply by its radius. An Arc2D has a radius, and also a startAngle and endAngle. All angles are specified in radians.

ArcClose2D

An ArcClose2D is similar to an Arc2D, having radius, startAngle and endAngle. In addition, there is a closureType field that specifies the type of return to the starting point. The two possible values for the closureType is PIE and CHORD.

Polypoint2D

The point field of a Polypoint2D contains a list of two dimensional points in the xy plane.

Polyline2D

The point field of a Polyline2D contains a list of two dimensional points in the xy plane. These points are connected to form a single polyline.

Disk2D

The Disk2D node has innerRadius and outerRadius fields. The innerRadius is less than the outerRadius and specifies the size of the hole in the center. The disk illustrated has innerRadius equal to 0. A texture is applied by pasting it onto the square that bounds the disk.

Rectangle2D

The size field of a Rectangle2D is a two dimensional vector that specifies the dimensions parallel to the x and y axes. A texture is stretched to fill the rectangle. For the texture the first direction is along the longest side. This is the u axis for the texture. The v axis is the other direction.

Rectangle2D

If the height is greater than the width, the y axis is the u axis for the texture. The v axis for the texture will be along the x axis. To preserve the orientation of the u and v axes, the texture faces toward the negative z axis.

If this texturing is not desired, it is necessary to create the rectangle with an IndexedFaceSet and the TextureCoordinates should be specified directly.

TriangleSet2D

The vertices field of the TriangleSet2D node contains a list of two dimensional points in the xy plane. The first three points form the first triangle, the next three points form the second triangle, etc. A texture is applied by finding the smallest rectangle that contains this triangle set, and then applying the texture to this rectangle.





































     
 
 

SwirlX3D Viewer


The SwirlX3D Viewer is a free standalone application for viewing VRML, X3D. It also displays sw3d archives created by the SwPublish program.
The professional version also displays files from other formst such as Collada(DAE), 3DS, OBJ, PLY, STL and IGES (IGS).
For more details ...

 

SwTranslator for VRML, X3D and Collada


The SwTranslator can export VRML, X3D, Collada(DAE), 3DS, OBJ, PLY, STL or IGES files to VRML, X3D or Collada. For X3D this offers a migration path for importing high quality 3D models from a variety of sources. For Collada, it offers an opportunity to bring geometry and animation into this increasingly popular format.
For more details ...