@prefix :        <https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/TextureMapping/TextureAngleViewer.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.3' ;
  x3do:noNamespaceSchemaLocation 'https://www.web3d.org/specifications/x3d-3.3.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_1 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'TextureAngleViewer.x3d' ;
  x3do:name 'title' .
:meta_1_2 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'View a given texture from different angles to judge readability, example use is a QR code.' ;
  x3do:name 'description' .
:meta_1_3 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'Don Brutzman' ;
  x3do:name 'creator' .
:meta_1_4 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content '23 April 2013' ;
  x3do:name 'created' .
:meta_1_5 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content '25 November 2024' ;
  x3do:name 'modified' .
:meta_1_6 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'color mapper in scene for varying Background contrast' ;
  x3do:name 'TODO' .
:meta_1_7 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'second X-axis angle slider' ;
  x3do:name 'TODO' .
:meta_1_8 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'TextureAngleViewer36degrees.png' ;
  x3do:name 'Image' .
:meta_1_9 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'images/QrNpsEduCode.png' ;
  x3do:name 'Image' .
:meta_1_10 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'http://qr.nps.edu' ;
  x3do:name 'reference' .
:meta_1_11 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'https://zxing.appspot.com/generator' ;
  x3do:name 'reference' .
:meta_1_12 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/TextureMapping/TextureAngleViewer.x3d' ;
  x3do:name 'identifier' .
:meta_1_13 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_14 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content '../license.html' ;
  x3do:name 'license' .
:meta dcterms:title "TextureAngleViewer.x3d" .
:meta dcterms:description "View a given texture from different angles to judge readability, example use is a QR code." .
:meta dcterms:creator "Don Brutzman" .
:meta dcterms:created "23 April 2013" .
:meta dcterms:modified "25 November 2024" .
:meta dcterms:Image "TextureAngleViewer36degrees.png" .
:meta dcterms:Image "images/QrNpsEduCode.png" .
:meta dcterms:reference "http://qr.nps.edu" .
:meta dcterms:reference "https://zxing.appspot.com/generator" .
:meta dcterms:identifier "https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/TextureMapping/TextureAngleViewer.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, :Background_2_2, :Viewpoint_2_3, :NavigationInfoFinal, :Transform_2_5, :Anchor_2_6, :SliderSituated, :SliderScript ;
  x3do:hasROUTE :ROUTE_2_9, :ROUTE_2_10, :ROUTE_2_11, :ROUTE_2_12 .
:WorldInfo_2_1 a owl:NamedIndividual, x3do:WorldInfo ;
  x3do:hasParent :Scene ;
  x3do:title 'Texture Angle Viewer' .
:Background_2_2 a owl:NamedIndividual, x3do:Background ;
  x3do:hasParent :Scene ;
  x3do:skyColor ( 0.72549 1 0.721569 ) .
:Viewpoint_2_3 a owl:NamedIndividual, x3do:Viewpoint ;
  x3do:hasParent :Scene ;
  x3do:description 'Texture angle viewer' ;
  x3do:position ( 0 0 11 ) .
:NavigationInfoFinal a owl:NamedIndividual, x3do:NavigationInfo ;
  x3do:hasParent :Scene ;
  x3do:DEF 'NavigationInfoFinal' ;
  x3do:type '"NONE"' .
:Transform_2_5 a owl:NamedIndividual, x3do:Transform ;
  x3do:hasParent :Scene ;
  x3do:hasChildren :Shape_2_5_1 ;
  x3do:translation ( 0 3.6 0 ) .
:Shape_2_5_1 a owl:NamedIndividual, x3do:Shape ;
  x3do:hasParent :Transform_2_5 ;
  x3do:hasGeometry :AngleOutputText ;
  x3do:hasAppearance :Appearance_2_5_1_2 .
:AngleOutputText a owl:NamedIndividual, x3do:Text ;
  x3do:hasParent :Shape_2_5_1 ;
  x3do:hasFontStyle :FontStyle_2_5_1_1_1 ;
  x3do:DEF 'AngleOutputText' ;
  x3do:string '"Texture angle viewer"' .
:FontStyle_2_5_1_1_1 a owl:NamedIndividual, x3do:FontStyle ;
  x3do:hasParent :AngleOutputText ;
  x3do:justify '"MIDDLE" "MIDDLE"' ;
  x3do:size 0.7 .
:Appearance_2_5_1_2 a owl:NamedIndividual, x3do:Appearance ;
  x3do:hasParent :Shape_2_5_1 ;
  x3do:hasMaterial :Material_2_5_1_2_1 .
:Material_2_5_1_2_1 a owl:NamedIndividual, x3do:Material ;
  x3do:hasParent :Appearance_2_5_1_2 ;
  x3do:diffuseColor ( 0.2 0.4 0.8 ) .
:Anchor_2_6 a owl:NamedIndividual, x3do:Anchor ;
  x3do:hasParent :Scene ;
  x3do:hasChildren :ImageTransform ;
  x3do:description 'this QR code links to http://qr.nps.edu' ;
  x3do:url '"http://qr.nps.edu"' .
:ImageTransform a owl:NamedIndividual, x3do:Transform ;
  x3do:hasParent :Anchor_2_6 ;
  x3do:hasChildren :Shape_2_6_1_1 ;
  x3do:DEF 'ImageTransform' .
:Shape_2_6_1_1 a owl:NamedIndividual, x3do:Shape ;
  x3do:hasParent :ImageTransform ;
  x3do:hasGeometry :IndexedFaceSet_2_6_1_1_1 ;
  x3do:hasAppearance :Appearance_2_6_1_1_2 .
:IndexedFaceSet_2_6_1_1_1 a owl:NamedIndividual, x3do:IndexedFaceSet ;
  x3do:hasParent :Shape_2_6_1_1 ;
  x3do:hasCoord :Coordinate_2_6_1_1_1_1 ;
  x3do:coordIndex ( 1 0 2 3 0 -1 ) .
:Coordinate_2_6_1_1_1_1 a owl:NamedIndividual, x3do:Coordinate ;
  x3do:hasParent :IndexedFaceSet_2_6_1_1_1 ;
  x3do:point ( -3 -3 0 3 -3 0 3 3 0 -3 3 0 -3 -3 0 ) .
:Appearance_2_6_1_1_2 a owl:NamedIndividual, x3do:Appearance ;
  x3do:hasParent :Shape_2_6_1_1 ;
  x3do:hasMaterial :Material_2_6_1_1_2_1 ;
  x3do:hasTexture :ImageTexture_2_6_1_1_2_2 .
:Material_2_6_1_1_2_1 a owl:NamedIndividual, x3do:Material ;
  x3do:hasParent :Appearance_2_6_1_1_2 .
:ImageTexture_2_6_1_1_2_2 a owl:NamedIndividual, x3do:ImageTexture ;
  x3do:hasParent :Appearance_2_6_1_1_2 ;
  x3do:url '"images/QrNpsEduCode.png" "https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/TextureMapping/images/QrNpsEduCode.png"' .
:SliderSituated a owl:NamedIndividual, x3do:Transform ;
  x3do:hasParent :Scene ;
  x3do:hasChildren :SliderKnobTransform, :SliderBar ;
  x3do:DEF 'SliderSituated' ;
  x3do:translation ( 0 -3.6 0 ) .
:SliderKnobTransform a owl:NamedIndividual, x3do:Transform ;
  x3do:hasParent :SliderSituated ;
  x3do:hasChildren :SliderPlaneSensor, :Transform_2_7_1_2 ;
  x3do:DEF 'SliderKnobTransform' .
:SliderPlaneSensor a owl:NamedIndividual, x3do:PlaneSensor ;
  x3do:hasParent :SliderKnobTransform ;
  x3do:DEF 'SliderPlaneSensor' ;
  x3do:description 'select and drag to change angle values' ;
  x3do:maxPosition ( 3 0 ) ;
  x3do:minPosition ( -3 0 ) .
:Transform_2_7_1_2 a owl:NamedIndividual, x3do:Transform ;
  x3do:hasParent :SliderKnobTransform ;
  x3do:hasChildren :Shape_2_7_1_2_1 ;
  x3do:rotation ( 0 0 1 1.570796 ) .
:Shape_2_7_1_2_1 a owl:NamedIndividual, x3do:Shape ;
  x3do:hasParent :Transform_2_7_1_2 ;
  x3do:hasGeometry :SliderKnob ;
  x3do:hasAppearance :Metals13Appearance .
:SliderKnob a owl:NamedIndividual, x3do:Cylinder ;
  x3do:hasParent :Shape_2_7_1_2_1 ;
  x3do:DEF 'SliderKnob' ;
  x3do:height 0.2 ;
  x3do:radius 0.2 .
:Metals13Appearance a owl:NamedIndividual, x3do:Appearance ;
  x3do:hasParent :Shape_2_7_1_2_1 ;
  x3do:hasMaterial :Material_2_7_1_2_1_2_1 ;
  x3do:DEF 'Metals13Appearance' .
:Material_2_7_1_2_1_2_1 a owl:NamedIndividual, x3do:Material ;
  x3do:hasParent :Metals13Appearance ;
  x3do:ambientIntensity 0.25641 ;
  x3do:diffuseColor ( 0.222308 0.15428 0 ) ;
  x3do:specularColor ( 0.882653 0.860832 0.687861 ) .
:SliderBar a owl:NamedIndividual, x3do:Transform ;
  x3do:hasParent :SliderSituated ;
  x3do:hasChildren :Shape_2_7_2_1 ;
  x3do:DEF 'SliderBar' ;
  x3do:rotation ( 0 0 1 1.570796 ) .
:Shape_2_7_2_1 a owl:NamedIndividual, x3do:Shape ;
  x3do:hasParent :SliderBar ;
  x3do:hasGeometry :Cylinder_2_7_2_1_1 ;
  x3do:hasAppearance :Metals13Appearance-USE-1 .
:Cylinder_2_7_2_1_1 a owl:NamedIndividual, x3do:Cylinder ;
  x3do:hasParent :Shape_2_7_2_1 ;
  x3do:height 6 ;
  x3do:radius 0.05 .
:Metals13Appearance-USE-1 a owl:NamedIndividual, x3do:Appearance ;
  x3do:hasParent :Shape_2_7_2_1 ;
  owl:sameAs :Metals13Appearance . # DEF matching this USE
:SliderScript a owl:NamedIndividual, x3do:Script ;
  x3do:hasParent :Scene ;
  x3do:hasField :field_2_8_1, :field_2_8_2, :field_2_8_3, :field_2_8_4, :field_2_8_5, :field_2_8_6, :field_2_8_7 ;
  x3do:DEF 'SliderScript' ;
  x3do:sourceCode """
ecmascript:

function set_translation (eventValue)
{
   x = eventValue.x;
   if (tracePrint)
   {
      Browser.println ('========================');
      Browser.println ('                  x=' + x);
   }
   // clamp values to prevent overrun/underrun, in case minPosition/maxPosition fail
   if (x >  3.0) x =  3.0;
   if (x < -3.0) x = -3.0;

   translation_changed = eventValue;
   angle = Math.round(x * 90.0 / 3.0);
   rotation_changed = new SFRotation (0, 1, 0, angle * Math.PI / 180.0);
   var angleString = angle.toString() + ' degrees'; // JavaScript string
   
// angleMFString_changed = new MFString (new SFString(angleString)); // only works in InstantReality
   angleMFString_changed = new MFString (angleString); // works in several players but not all
// angleMFString_changed = [ angleString ]; // Use JavaScript string array instead of MFString doesn't work
   
   if (tracePrint)
   {
      Browser.println ('          clamped x=' + x);
      Browser.println ('    set_translation=' + eventValue);
      Browser.println ('translation_changed=' + translation_changed.toString() + ', rotation_changed=' + rotation_changed.toString());
      Browser.println (''angle=' + angle + ', angleString=' + angleString + ', angleMFString_changed=' + angleMFString_changed.toString());
   }
/*
example console excerpt:
========================
                  x=-0.05248255282640457
          clamped x=-0.05248255282640457
    set_translation=-0.05248255282640457 0 0
translation_changed=-0.05248255282640457 0 0, rotation_changed=0 1 0 -0.03490658503988659
angle=-2, angleString=-2 degrees, angleMFString_changed=-2 degrees
========================
*/
}
""" .
:field_2_8_1 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :SliderScript ;
  x3do:accessType 'inputOnly' ;
  x3do:appinfo 'input provided by SliderKnobTransform PlaneSensor output' ;
  x3do:name 'set_translation' ;
  x3do:type 'SFVec3f' .
:field_2_8_2 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :SliderScript ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'angle' ;
  x3do:type 'SFFloat' ;
  x3do:value 0.0 .
:field_2_8_3 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :SliderScript ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'y' ;
  x3do:type 'SFFloat' ;
  x3do:value 0.0 .
:field_2_8_4 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :SliderScript ;
  x3do:accessType 'outputOnly' ;
  x3do:appinfo 'output provided for ImageTransform rotation' ;
  x3do:name 'rotation_changed' ;
  x3do:type 'SFRotation' .
:field_2_8_5 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :SliderScript ;
  x3do:accessType 'outputOnly' ;
  x3do:appinfo 'output provided for SliderKnobTransform translation' ;
  x3do:name 'translation_changed' ;
  x3do:type 'SFVec3f' .
:field_2_8_6 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :SliderScript ;
  x3do:accessType 'outputOnly' ;
  x3do:appinfo 'output provided for degrees of rotation in Text node' ;
  x3do:name 'angleMFString_changed' ;
  x3do:type 'MFString' .
:field_2_8_7 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :SliderScript ;
  x3do:accessType 'initializeOnly' ;
  x3do:appinfo 'console output for debugging' ;
  x3do:name 'tracePrint' ;
  x3do:type 'SFBool' ;
  x3do:value true .
:ROUTE_2_9 a owl:NamedIndividual, x3do:ROUTE ;
  x3do:hasParent :Scene ;
  x3do:fromField 'translation_changed' ;
  x3do:fromNode 'SliderPlaneSensor' ;
  x3do:toField 'set_translation' ;
  x3do:toNode 'SliderScript' .
:ROUTE_2_10 a owl:NamedIndividual, x3do:ROUTE ;
  x3do:hasParent :Scene ;
  x3do:fromField 'translation_changed' ;
  x3do:fromNode 'SliderScript' ;
  x3do:toField 'translation' ;
  x3do:toNode 'SliderKnobTransform' .
:ROUTE_2_11 a owl:NamedIndividual, x3do:ROUTE ;
  x3do:hasParent :Scene ;
  x3do:fromField 'rotation_changed' ;
  x3do:fromNode 'SliderScript' ;
  x3do:toField 'rotation' ;
  x3do:toNode 'ImageTransform' .
:ROUTE_2_12 a owl:NamedIndividual, x3do:ROUTE ;
  x3do:hasParent :Scene ;
  x3do:fromField 'angleMFString_changed' ;
  x3do:fromNode 'SliderScript' ;
  x3do:toField 'string' ;
  x3do:toNode 'AngleOutputText' .
