[x3d-public] New X3D JSON Loader that is namespace aware optionally.

John Carlson yottzumm at gmail.com
Fri Feb 26 12:00:36 PST 2016


I cannot figure out why the xhtml namespace shows the scene correctly.  You can now play with namespaces on my loader page @ http://coderextreme.net/X3DJSONLD/ <http://coderextreme.net/X3DJSONLD/>  to see what the differences are.  As far as I can tell the XML serializes properly.  I guess there may be an error in how my code brings the serialized XML DOM into the document.

John
> On Feb 26, 2016, at 11:03 AM, Don Brutzman <brutzman at nps.edu> wrote:
> 
> On 2/25/2016 11:14 PM, John Carlson wrote:
>> I have been having problems generating XML for consumption by Cobweb.  I finally discovered that I needed to set a namespace.  When I set a namespace, then X3DOM no longer work as well.  So I made namespace optional.
>> 
>> New version is here:
>> 
>> http://coderextreme.net/X3DJSONLD/
>> 
>> https://github.com/coderextreme/X3DJSONLD/
>> 
>> Happy X3D JSONing!
> 
> Hi John, great to see that you are making such progress.
> 
> I loaded your new version in Firefox and used Firebug to inspect the DOM tree.  Got a blue background for X3DOM, both Cobweb insets had Flipper happily swimming off to port.
> 
> Issues noted:
> 
> - Looks like each X3D Scene element is being loaded as a child of its predecessor, rather than a peer.
> 
> - The parent-child relationships were not evident until I inspected source with Firebug (HTML tab provides tree view) and then confirmed in X3D-Edit (by using right-click for formatting the source to insert indents).
> 
> - Not seeing a <head> element around the <meta> elements
> 
> - Looks like you have a <canvas> and two <div> elements inserted between the closing </scene> and </x3d>, effectively asking x3dom to render them. those likely should be past the </x3d> closing tag so that the html browser can render them.
> 
> - Suggest you turn on the X3DOM console to see what it thinks, might be a good option to keep for future inspection also.
> 
> - The namespace issue is interesting.  Is there X3DOM documentation on this?  X3D documentation found at
> 
> 	Validation of X3D Scenes using DTD and XML Schema
> 	http://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#Validation
> 
> Hope this helps, will be on the weekly JSON call in 2 hours, aloha.
> 
> 
> <div id="x3domxml">
> 	<x3d id="x3dele" xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance" xsd:nonamespaceschemalocation="http://www.web3d.org/specifications/x3d-3.3.xsd" version="3.3" profile="Immersive" xmlns="http://www.x3dom.org/x3dom" width="300px" height="150px">
> 		<meta content="hand conversion from http://www.x3dom.org/x3dom/test/functional/flipper.html" name="generator">
> 			<meta content="flipper.x3d" name="title">
> 				<meta content="flipper flopping around" name="description">
> 					<meta content="http://www.x3dom.org/x3dom/test/functional/flipper.x3d" name="identifier">
> 						<meta content="Yvonne Jung, metadata by John Carlson" name="creator">
> 							<meta content="24 February 2016" name="translated">
> 								<meta content="X3dToJson.xslt, http://www.web3d.org/x3d/stylesheets/X3dToJson.html" name="generator">
> 									<meta content="An experimental version of X3D JSON encoding is used for this scene. Status online at http://www.web3d.org/wiki/index.php/X3D_JSON_Encoding" name="warning">
> 										<scene render="true" bboxcenter="0,0,0" bboxsize="-1,-1,-1" pickmode="idBuf" dopickpass="true">
> 											<viewpoint class="cam0" position="0 0 800" description="cam0 description" def="cam0" fieldofview="0.785398" orientation="0,0,0,0" centerofrotation="0,0,0" znear="-1" zfar="-1">
> 												<viewpoint class="cam1" position="0 0 2000" description="cam1 description" def="cam1" fieldofview="0.785398" orientation="0,0,0,0" centerofrotation="0,0,0" znear="-1" zfar="-1">
> 													<viewpoint class="cam2" position="0 200 1000" description="cam2 description" def="cam2" fieldofview="0.785398" orientation="0,0,0,0" centerofrotation="0,0,0" znear="-1" zfar="-1">
> 														<background skytransparency="0.5 0.5 0.5 0.5" groundtransparency="0.5 0.5 0.5 0.5" skycolor="0.21 0.18 0.66 0.2 0.44 0.85 0.51 0.81 0.95 0.51 0.81 0.95" skyangle="0.9 1.5 1.57" groundcolor="0.21 0.18 0.66 0.2 0.44 0.85 0.51 0.81 0.95 0.51 0.81 0.95" groundangle="0.9 1.5 1.57" backurl="" bottomurl="" fronturl="" lefturl="" righturl="" topurl="">
> 															<navigationinfo class="user01" speed="50" def="user01" headlight="true" type="EXAMINE ANY " typeparams="-0.4,60,0.05,2.8" explorationmode="all" avatarsize="0.25,1.6,0.75" transitiontime="1" transitiontype="LINEAR ">
> 																<fog color="1,1,1" fogtype="LINEAR">
> 																	<transform class="trans" rotation="1 0 0 0.78" def="trans" render="true" bboxcenter="0,0,0" bboxsize="-1,-1,-1" center="0,0,0" translation="0,0,0" scale="1,1,1" scaleorientation="0,0,0,0">
> 																		<shape render="true" bboxcenter="0,0,0" bboxsize="-1,-1,-1" ispickable="true">
> 																	</transform>
> 																	<timesensor class="ts" loop="true" description="Make the dolphin move" cycleinterval="2" def="ts" enabled="true" first="true">
> 																</fog>
> 															</navigationinfo>
> 														</background>
> 													</viewpoint>
> 												</viewpoint>
> 											</viewpoint>
> 										</scene>
> 										<canvas id="x3dom-x3dele-canvas" class="x3dom-canvas" tabindex="0" width="300" height="150"></canvas>
> 										<div id="x3dom-state-viewer" style="display: none;">
> 											<div class="x3dom-progress" style="display: none;">
> 		[... snip, iconized ...]
> 	</x3d>
> </div>
> 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20160226/0af6e8fd/attachment-0001.html>


More information about the x3d-public mailing list