@prefix :        <https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/ViewPositionOrientationPrototype.ttl#> .
@prefix owl:     <http://www.w3.org/2002/07/owl#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema:  <http://schema.org/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .
@prefix x3d:     <https://www.web3d.org/specifications/x3d-4.0.xsd#> .
@prefix x3do:    <https://www.web3d.org/specifications/X3dOntology4.0#> .

:X3D a owl:NamedIndividual, x3do:X3D ;
  x3do:hasHead :head ;
  x3do:hasScene :Scene ;
  x3do:profile 'Immersive' ;
  x3do:version '3.0' ;
  x3do:noNamespaceSchemaLocation 'https://www.web3d.org/specifications/x3d-3.0.xsd' .
:head a owl:NamedIndividual, x3do:head ;
  x3do:hasParent :X3D ;
  x3do:hasMeta :meta_1_1, :meta_1_2, :meta_1_3, :meta_1_4, :meta_1_5, :meta_1_6, :meta_1_7, :meta_1_8, :meta_1_9, :meta_1_10, :meta_1_11, :meta_1_12, :meta_1_13, :meta_1_14, :meta_1_15 .
:meta_1_1 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'ViewPositionOrientationPrototype.x3d' ;
  x3do:name 'title' .
:meta_1_2 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'Leonard Daly and Don Brutzman' ;
  x3do:name 'creator' .
:meta_1_3 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'Don Brutzman' ;
  x3do:name 'translator' .
:meta_1_4 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content '1 November 2000' ;
  x3do:name 'created' .
:meta_1_5 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content '28 November 2019' ;
  x3do:name 'modified' .
:meta_1_6 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'ViewPositionOrientation prototype provides local position and orientation as user navigates, with optional console output' ;
  x3do:name 'description' .
:meta_1_7 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'Note fix: metadata is no longer an allowed ProtoDeclare field name, since ProtoInstance already includes a metadata field' ;
  x3do:name 'info' .
:meta_1_8 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'ViewPositionOrientationExample.x3d' ;
  x3do:name 'reference' .
:meta_1_9 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter14Prototypes/WhereAmIExample.x3d' ;
  x3do:name 'reference' .
:meta_1_10 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter14Prototypes/WhereAmIPrototype.x3d' ;
  x3do:name 'reference' .
:meta_1_11 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'http://www.realism.com/Web3D/Examples#WhereAmI' ;
  x3do:name 'reference' .
:meta_1_12 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'http://www.realism.com/vrml/Example/WhereAmI/WhereAmI_Proto.wrl' ;
  x3do:name 'reference' .
:meta_1_13 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/ViewPositionOrientationPrototype.x3d' ;
  x3do:name 'identifier' .
:meta_1_14 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit' ;
  x3do:name 'generator' .
:meta_1_15 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content '../../license.html' ;
  x3do:name 'license' .
:meta dcterms:title "ViewPositionOrientationPrototype.x3d" .
:meta dcterms:creator "Leonard Daly and Don Brutzman" .
:meta dcterms:translator "Don Brutzman" .
:meta dcterms:created "1 November 2000" .
:meta dcterms:modified "28 November 2019" .
:meta dcterms:description "ViewPositionOrientation prototype provides local position and orientation as user navigates, with optional console output" .
:meta dcterms:info "Note fix: metadata is no longer an allowed ProtoDeclare field name, since ProtoInstance already includes a metadata field" .
:meta dcterms:reference "ViewPositionOrientationExample.x3d" .
:meta dcterms:reference "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter14Prototypes/WhereAmIExample.x3d" .
:meta dcterms:reference "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter14Prototypes/WhereAmIPrototype.x3d" .
:meta dcterms:reference "http://www.realism.com/Web3D/Examples#WhereAmI" .
:meta dcterms:reference "http://www.realism.com/vrml/Example/WhereAmI/WhereAmI_Proto.wrl" .
:meta dcterms:identifier "https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/ViewPositionOrientationPrototype.x3d" .
:meta dcterms:generator "X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit" .
:meta dcterms:license "../../license.html" .
:Scene a owl:NamedIndividual, x3do:Scene ;
  x3do:hasParent :X3D ;
  x3do:hasChildren :WorldInfo_2_1, :Viewpoint_2_3, :Anchor_2_4 ;
  x3do:hasProtoDeclare :ProtoDeclare_2_2 .
:WorldInfo_2_1 a owl:NamedIndividual, x3do:WorldInfo ;
  x3do:hasParent :Scene ;
  x3do:title 'ViewPositionOrientationPrototype.x3d' .
:ProtoDeclare_2_2 a owl:NamedIndividual, x3do:ProtoDeclare ;
  x3do:hasParent :Scene ;
  x3do:hasProtoInterface :ProtoInterface_2_2_1 ;
  x3do:hasProtoBody :ProtoBody_2_2_2 ;
  x3do:appinfo 'ViewPositionOrientation provides provides console output of local position and orientation as user navigates' ;
  x3do:name 'ViewPositionOrientation' .
:ProtoInterface_2_2_1 a owl:NamedIndividual, x3do:ProtoInterface ;
  x3do:hasParent :ProtoDeclare_2_2 ;
  x3do:hasField :field_2_2_1_1, :field_2_2_1_2, :field_2_2_1_3, :field_2_2_1_4, :field_2_2_1_5, :field_2_2_1_6 .
:field_2_2_1_1 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_2_1 ;
  x3do:accessType 'inputOutput' ;
  x3do:appinfo 'Whether or not ViewPositionOrientation sends output to console' ;
  x3do:name 'enabled' ;
  x3do:type 'SFBool' ;
  x3do:value true .
:field_2_2_1_2 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_2_1 ;
  x3do:accessType 'initializeOnly' ;
  x3do:appinfo 'Output internal trace messages for debugging this node, intended for developer use only' ;
  x3do:name 'traceEnabled' ;
  x3do:type 'SFBool' ;
  x3do:value true .
:field_2_2_1_3 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_2_1 ;
  x3do:accessType 'inputOnly' ;
  x3do:appinfo 'Ability to turn output tracing on/off at runtime' ;
  x3do:name 'set_traceEnabled' ;
  x3do:type 'SFBool' .
:field_2_2_1_4 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_2_1 ;
  x3do:accessType 'outputOnly' ;
  x3do:appinfo 'Output local position' ;
  x3do:name 'position_changed' ;
  x3do:type 'SFVec3f' .
:field_2_2_1_5 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_2_1 ;
  x3do:accessType 'outputOnly' ;
  x3do:appinfo 'Output local orientation' ;
  x3do:name 'orientation_changed' ;
  x3do:type 'SFRotation' .
:field_2_2_1_6 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_2_1 ;
  x3do:accessType 'outputOnly' ;
  x3do:appinfo 'MFString value of new Viewpoint, suitable for use in string field of a Text node' ;
  x3do:name 'outputViewpointString' ;
  x3do:type 'MFString' .
:ProtoBody_2_2_2 a owl:NamedIndividual, x3do:ProtoBody ;
  x3do:hasParent :ProtoDeclare_2_2 ;
  x3do:hasChildren :WhereSensor, :OutputPositionOrientation ;
  x3do:hasROUTE :ROUTE_2_2_2_3, :ROUTE_2_2_2_4 .
:WhereSensor a owl:NamedIndividual, x3do:ProximitySensor ;
  x3do:hasParent :ProtoBody_2_2_2 ;
  x3do:hasIS :IS_2_2_2_1_1 ;
  x3do:DEF 'WhereSensor' ;
  x3do:size ( 1000000000 1000000000 1000000000 ) .
:IS_2_2_2_1_1 a owl:NamedIndividual, x3do:IS ;
  x3do:hasParent :WhereSensor ;
  x3do:hasConnect :connect_2_2_2_1_1_1 .
:connect_2_2_2_1_1_1 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_2_2_1_1 ;
  x3do:nodeField 'enabled' ;
  x3do:protoField 'enabled' .
:OutputPositionOrientation a owl:NamedIndividual, x3do:Script ;
  x3do:hasParent :ProtoBody_2_2_2 ;
  x3do:hasField :field_2_2_2_2_1, :field_2_2_2_2_2, :field_2_2_2_2_3, :field_2_2_2_2_4, :field_2_2_2_2_5, :field_2_2_2_2_6, :field_2_2_2_2_7, :field_2_2_2_2_8, :field_2_2_2_2_9 ;
  x3do:hasIS :IS_2_2_2_2_10 ;
  x3do:DEF 'OutputPositionOrientation' ;
  x3do:sourceCode """
ecmascript:

function roundoff (value, digits) // for local use only
{
	var resolution = 1;
	for (i = 1; i <= digits; i++ )
	{
		resolution *= 10;
	}
	return Math.round (value*resolution) / resolution; // round to resolution
}
function outputViewpoint ()
{
  var holdString = 
        '<Viewpoint position=\"' +
		roundoff (position.x, 1) + ' ' +
		roundoff (position.y, 1) + ' ' +
		roundoff (position.z, 1) +
        '\" orientation=\"' +
		roundoff (orientation.x, 3) + ' ' +
		roundoff (orientation.y, 3) + ' ' +
		roundoff (orientation.z, 3) + ' ' +
		roundoff (orientation.angle, 4) + '\"/>' ;
   tracePrint (holdString);
   outputViewpointString = new MFString (holdString);
}
function set_position (value)
{
	position = value; // save persistent value
	position_changed = position; // output event
	outputViewpoint ();
}
function set_orientation (value)
{
	orientation = value; // save persistent value
	orientation_changed = orientation; // output event
	outputViewpoint ();
}
function set_traceEnabled (value)
{
	traceEnabled = value;
	alwaysPrint ('traceEnabled=' + traceEnabled);
}
function alwaysPrint (text)
{
	Browser.println ('[ViewPositionOrientation] ' + text);
}
function tracePrint (text)
{
	if (traceEnabled) alwaysPrint (text);
}
""" .
:field_2_2_2_2_1 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :OutputPositionOrientation ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'traceEnabled' ;
  x3do:type 'SFBool' .
:field_2_2_2_2_2 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :OutputPositionOrientation ;
  x3do:accessType 'inputOnly' ;
  x3do:name 'set_traceEnabled' ;
  x3do:type 'SFBool' .
:field_2_2_2_2_3 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :OutputPositionOrientation ;
  x3do:accessType 'inputOnly' ;
  x3do:name 'set_position' ;
  x3do:type 'SFVec3f' .
:field_2_2_2_2_4 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :OutputPositionOrientation ;
  x3do:accessType 'inputOnly' ;
  x3do:name 'set_orientation' ;
  x3do:type 'SFRotation' .
:field_2_2_2_2_5 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :OutputPositionOrientation ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'position' ;
  x3do:type 'SFVec3f' ;
  x3do:value ( 0 0 0 ) .
:field_2_2_2_2_6 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :OutputPositionOrientation ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'orientation' ;
  x3do:type 'SFRotation' ;
  x3do:value ( 0 1 0 0 ) .
:field_2_2_2_2_7 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :OutputPositionOrientation ;
  x3do:accessType 'outputOnly' ;
  x3do:name 'position_changed' ;
  x3do:type 'SFVec3f' .
:field_2_2_2_2_8 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :OutputPositionOrientation ;
  x3do:accessType 'outputOnly' ;
  x3do:name 'orientation_changed' ;
  x3do:type 'SFRotation' .
:field_2_2_2_2_9 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :OutputPositionOrientation ;
  x3do:accessType 'outputOnly' ;
  x3do:name 'outputViewpointString' ;
  x3do:type 'MFString' .
:IS_2_2_2_2_10 a owl:NamedIndividual, x3do:IS ;
  x3do:hasParent :OutputPositionOrientation ;
  x3do:hasConnect :connect_2_2_2_2_10_1, :connect_2_2_2_2_10_2, :connect_2_2_2_2_10_3, :connect_2_2_2_2_10_4, :connect_2_2_2_2_10_5 .
:connect_2_2_2_2_10_1 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_2_2_2_10 ;
  x3do:nodeField 'traceEnabled' ;
  x3do:protoField 'traceEnabled' .
:connect_2_2_2_2_10_2 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_2_2_2_10 ;
  x3do:nodeField 'set_traceEnabled' ;
  x3do:protoField 'set_traceEnabled' .
:connect_2_2_2_2_10_3 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_2_2_2_10 ;
  x3do:nodeField 'position_changed' ;
  x3do:protoField 'position_changed' .
:connect_2_2_2_2_10_4 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_2_2_2_10 ;
  x3do:nodeField 'orientation_changed' ;
  x3do:protoField 'orientation_changed' .
:connect_2_2_2_2_10_5 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_2_2_2_10 ;
  x3do:nodeField 'outputViewpointString' ;
  x3do:protoField 'outputViewpointString' .
:ROUTE_2_2_2_3 a owl:NamedIndividual, x3do:ROUTE ;
  x3do:hasParent :ProtoBody_2_2_2 ;
  x3do:fromField 'position_changed' ;
  x3do:fromNode 'WhereSensor' ;
  x3do:toField 'set_position' ;
  x3do:toNode 'OutputPositionOrientation' .
:ROUTE_2_2_2_4 a owl:NamedIndividual, x3do:ROUTE ;
  x3do:hasParent :ProtoBody_2_2_2 ;
  x3do:fromField 'orientation_changed' ;
  x3do:fromNode 'WhereSensor' ;
  x3do:toField 'set_orientation' ;
  x3do:toNode 'OutputPositionOrientation' .
:Viewpoint_2_3 a owl:NamedIndividual, x3do:Viewpoint ;
  x3do:hasParent :Scene ;
  x3do:description 'ViewPositionOrientation prototype' ;
  x3do:position ( 0 0 14 ) .
:Anchor_2_4 a owl:NamedIndividual, x3do:Anchor ;
  x3do:hasParent :Scene ;
  x3do:hasChildren :Shape_2_4_1, :Shape_2_4_2 ;
  x3do:description 'ViewPositionOrientation Example' ;
  x3do:parameter '"target=_blank"' ;
  x3do:url '"ViewPositionOrientationExample.x3d" "https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/ViewPositionOrientationExample.x3d" "ViewPositionOrientationExample.wrl" "https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/ViewPositionOrientationExample.wrl"' .
:Shape_2_4_1 a owl:NamedIndividual, x3do:Shape ;
  x3do:hasParent :Anchor_2_4 ;
  x3do:hasGeometry :Text_2_4_1_1 ;
  x3do:hasAppearance :Appearance_2_4_1_2 .
:Text_2_4_1_1 a owl:NamedIndividual, x3do:Text ;
  x3do:hasParent :Shape_2_4_1 ;
  x3do:hasFontStyle :FontStyle_2_4_1_1_1 ;
  x3do:string '"ViewPositionOrientationPrototype" "is a prototype definition file" "" "Click this text to see" "ViewPositionOrientationExample"' .
:FontStyle_2_4_1_1_1 a owl:NamedIndividual, x3do:FontStyle ;
  x3do:hasParent :Text_2_4_1_1 ;
  x3do:justify '"MIDDLE" "MIDDLE"' ;
  x3do:size 1.2 .
:Appearance_2_4_1_2 a owl:NamedIndividual, x3do:Appearance ;
  x3do:hasParent :Shape_2_4_1 ;
  x3do:hasMaterial :Material_2_4_1_2_1 .
:Material_2_4_1_2_1 a owl:NamedIndividual, x3do:Material ;
  x3do:hasParent :Appearance_2_4_1_2 ;
  x3do:diffuseColor ( 0.6 0.8 0.4 ) .
:Shape_2_4_2 a owl:NamedIndividual, x3do:Shape ;
  x3do:hasParent :Anchor_2_4 ;
  x3do:hasGeometry :Box_2_4_2_1 ;
  x3do:hasAppearance :Appearance_2_4_2_2 .
:Box_2_4_2_1 a owl:NamedIndividual, x3do:Box ;
  x3do:hasParent :Shape_2_4_2 ;
  x3do:size ( 16 7 .001 ) .
:Appearance_2_4_2_2 a owl:NamedIndividual, x3do:Appearance ;
  x3do:hasParent :Shape_2_4_2 ;
  x3do:hasMaterial :Material_2_4_2_2_1 .
:Material_2_4_2_2_1 a owl:NamedIndividual, x3do:Material ;
  x3do:hasParent :Appearance_2_4_2_2 ;
  x3do:transparency 1 .
