[x3d-public] Proposal amendment: implicit fields in x3dv

Yves Piguet yves.piguet at gmail.com
Tue Aug 30 07:15:20 PDT 2016


Hi,

A minor change to my proposal sent to this mailing list on April 19 entitled "implicit fields in x3dv": no need for "!" as a field name placeholder. The amended proposal is as follows:

For SFNode fields (explicit nodes optionally preceded by DEF, i.e. "nodeTypeId { nodeBody }" or "DEF nodeNameId nodeTypeId { nodeBody }"), the field name is optional if the field corresponds to the SFNode's containerField. For MFNode fields, the field name is also optional, and multiple nodes are collected as a single MFNode. The containerField of a PROTO is the containerField of the first node of its body.

Example:

Transform {
  rotation 1 0 0 1.58
  Shape {
    Box {
      size 3 0.5 3
    }
    Appearance {
      Material {
        diffuseColor 1 0 0
      }
    }
  }
  Shape {
    Sphere {}
    Appearance {
      ImageTexture {
        url "texture:checkerboard"
      }
    }
  }
}

is equivalent to

Transform {
  rotation 1 0 0 1.58
  children [
    Shape {
      geometry Box {
        size 3 0.5 3
      }
      appearance Appearance {
        material Material {
          diffuseColor 1 0 0
        }
      }
    }
    Shape {
      geometry Sphere {}
      appearance Appearance {
        texture ImageTexture {
          url "texture:checkerboard"
        }
      }
    }
  ]
}

I've tested it in our experimental JavaScript X3D implementation, it looks fine, and more in sync with X3D XML. Feedback welcome...

Yves




More information about the x3d-public mailing list