[X3D-Public] [X3D-Earth] X3DOM Geospatial examples, updating Geospatial.js

Don Brutzman brutzman at nps.edu
Tue Apr 30 07:51:50 PDT 2013


On 4/28/2013 2:18 PM, Behr, Johannes wrote:
> AFAIK is there almost no functionality. Just some fragments to get a specific set of content working.
> The person is also not available anymore and we don't know the current status.
> Potential developer have to use the code as starting point.

Acknowledged, thank you Johannes.

It looks like the source for all X3DOM geospatial nodes is available at

	https://github.com/x3dom/x3dom/blob/1.3.0/src/nodes/Geospatial.js

Contained there:

lines 15-16
> "GeoCoordinate",
>     "Geospatial",

Looks like these lines defined GeoCoordinate node as part of Geospatial 
component.

lines 21-23:
>             this.addField_MFVec3f(ctx, 'point', []);
>             this.addField_MFString(ctx, 'geoSystem', ['GD', 'WE']);
>             this.addField_SFNode('geoOrigin', x3dom.nodeTypes.GeoOrigin);

This matches the specification field definitions in
25.3.1 GeoCoordinate
http://www.web3d.org/files/specifications/19775-1/V3.3/Part01/components/geodata.html#GeoCoordinate
GeoCoordinate : X3DCoordinateNode {
   SFNode   [in,out] metadata  NULL        [X3DMetadataObject]
   MFVec3d  [in,out] point     []          (-∞,∞)
   SFNode   []       geoOrigin NULL        [GeoOrigin] (deprecated)
   MFString []       geoSystem ["GD","WE"] [see 25.2.3]
}

The rest of the node methods appear to be pretty complete.  This was 
corroborated by Byounghyun Yoo's successful creation of x3dom geospatial 
examples using IndexedFaceSet/IndexedLineSet with GeoCoordinate.

ByoungHyun please provide 1-2 simple example scenes for inclusion in the 
public example archives, TIA.

lines 243-269:
> /* ### GeoElevationGrid ### */
> x3dom.registerNodeType(
>     "GeoElevationGrid",
>     "Geospatial",
>     defineClass(x3dom.nodeTypes.X3DGeometryNode,
>         function (ctx) {
>             x3dom.nodeTypes.GeoElevationGrid.superClass.call(this, ctx);
>
>             this.addField_MFString(ctx, 'geoSystem', ['GD', 'WE']);
>             this.addField_SFVec3d(ctx, 'geoGridOrigin', 0, 0, 0);
>             this.addField_MFDouble(ctx, 'height', 0, 0);
>             this.addField_SFBool(ctx, 'ccw', true);
>             //this.addField_SFBool(ctx, 'colorPerVertex', true);
>             //this.addField_SFDouble(ctx, 'creaseAngle', 0);
>             //this.addField_SFBool(ctx, 'normalPerVertex', true);
>             //this.addField_SFBool(ctx, 'solid', true);
>             this.addField_SFInt32(ctx, 'xDimension', 0);
>             this.addField_SFDouble(ctx, 'xSpacing', 1.0);
>             this.addField_SFFloat(ctx, 'yScale', 1);
>             this.addField_SFInt32(ctx, 'zDimension', 0);
>             this.addField_SFDouble(ctx, 'zSpacing', 1.0);
>             // this.addField_SFNode('color', x3dom.nodeTypes.PropertySetGeometry);
>             // this.addField_SFNode('normal', x3dom.nodeTypes.PropertySetGeometry);
>             // this.addField_SFNode('texCoord', x3dom.nodeTypes.PropertySetGeometry);
>             this.addField_SFNode('geoOrigin', x3dom.nodeTypes.GeoOrigin);
>             this.addField_SFBool(ctx, 'lit', true);
>         },

A variety of geoSystem field functions for geospatial coordinate 
conversions are provided in the body for this node.  They should help a lot.

presumably the color, normal and texCoord fields could be added by 
copying/adapting source found other node examples, such as ElevationGrid.
https://github.com/x3dom/x3dom/blob/1.3.0/src/nodes/Geometry3D.js
lines 156-312

However I don't think that GeoElevationGrid is yet working, as evidenced by
http://www.web3d.org/x3d/content/examples/Basic/Geospatial/A1_GeoElevationGrid.x3d
http://www.web3d.org/x3d/content/examples/Basic/Geospatial/A1_GeoElevationGrid.xhtml

where the x3dom console reports
	WARNING: Unrecognised X3D element <GeoElevationGrid>.
	WARNING: Unrecognised X3D element <GeoViewpoint>.

The remaining geospatial node definitions look to be stubs, but all of 
the fields are defined for each.  Again, it would seem that code could 
be copied from the non-geospatial versions of these nodes:

GeoLOD, GeoLocation, GeoMetadata, GeoOrigin, GeoPositionInterpolator, 
GeoProximitySensor, GeoTouchSensor, GeoTransform, GeoViewpoint.

Another factor in our favor is that we don't have to worry about single 
versus double floating-point precision.  Everything is a double in 
Javascript.

Is someone willing to work on the javascript source for building these 
node implementations, one by one?  GeoElevationGrid would be first 
candidate since it is partly implemented.

We could test changes via the web3d.org server without too much 
difficulty and avoid any disruption/dependence on the trunk 
infrastructure, then give the updates back to Fraunhofer for 
confirmation and integration.

I'm willing to make corresponding updates to the X3D Basic Examples - 
Geospatial (for test scenes).  Am also willing to update X3dToX3dom.xslt 
(revised warning just checked in) and X3D-Edit to match the evolving 
changes to facilitate changes.

all the best, Don
-- 
Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman



More information about the X3D-Public mailing list