[X3D-Public] SFNode and MFNode

Sajjadul Islam sajis997 at student.liu.se
Wed May 4 13:35:28 PDT 2011


On Thu, Apr 28, 2011 at 7:10 PM, Michalis Kamburelis <
michalis.kambi at gmail.com> wrote:

> Sajjadul Islam wrote:
> > Hello forum,
> >
> > What is the purpose of these two field types?
> >
> > I have not found any examples where these field types are specified
> > explicitly by the user. The default value is always NULL.
> >
> >
> > Any reference example to their usage will be very helpful.
> >
> >
>
> Pretty much every VRML 2.0 and X3D file is an example of SFNode and
> MFNode usage. These fields allow you to place one node within the other
> (for example, place "Sphere" node inside "geometry" field of "Shape"
> node, which is inside "children" field of "Group" node and so on).


Consider the following example picked from the book "Extensible 3D Graphics
  for Web Authors":

<Shape>
     <Sphere radius="10.0" Solid="true" />

     <Appearance>
          <ImageTexture = "earth-topo.png" />
     </Appearance>
</Shape>

In the above example Shape node contains some child nodes. This node has two
fields of type SFNode ; one for the geometry and the other for the
appearance. And Node of this nodes are edited explicitly by the author. Will
they be still NULL? Should it not be something the following:

<Shape geometry=? appearance=?>
     <Sphere radius="10.0" Solid="true" />

     <Appearance>
          <ImageTexture = "earth-topo.png" />
     </Appearance>
</Shape>


 "?" means i do not know what to put there.

> They
> are quite at the core of the VRML/X3D "nodes graph" idea :)
>
> SFNode contains one child node or NULL, and all SFNode fields inside
> standard nodes indeed have a default value always NULL. MFNode contains
> any number of child nodes, and all MFNode fields inside standard nodes
> have a default value = [] (empty list).
>
> Michalis
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20110504/c73a104a/attachment.html>


More information about the X3D-Public mailing list