This approach uses the createVrmlFromString method of the
vrml.external.Browser class and the resulting node is added to the
scene graph using the addChildren eventIn of the Group
nodes. The argument of this method is a string containing VRML syntax.
The string is handed to the VRML syntax parser of the VRML plug-in and
an array of VRML nodes is returned.
We build VRML syntax in strings using the triangle data, which was
received from the server. For each level of the iso-surface two
strings containing VRML syntax are generated. The strings describe a
Shape node with Appearance and Geometry sub-nodes.
The vertex coordinates are converted into strings and inserted into
the VRML syntax string. The indices of the IndexedFaceSet node
are created on the client, since only the vertices of the triangles
are sent.
This approach works out fine, but with increasing number of triangles,
the performance decreases considerably. String operations using Java are
very slow, so it would be a much better way to send the vertex data
received from the server directly to a Geometry node.