{"id":37,"date":"2015-08-23T11:00:54","date_gmt":"2015-08-23T11:00:54","guid":{"rendered":"http:\/\/osiris.itabc.cnr.it\/scenebaker\/?p=37"},"modified":"2015-08-31T07:46:53","modified_gmt":"2015-08-31T07:46:53","slug":"customizing-the-webgl-front-end","status":"publish","type":"post","link":"https:\/\/osiris.itabc.cnr.it\/scenebaker\/index.php\/2015\/08\/23\/customizing-the-webgl-front-end\/","title":{"rendered":"Customizing the WebGL Front-End"},"content":{"rendered":"<p align=\"justify\">This is a bit more technical post about customizing the main PHP component, responsible for main HTML5\/js Front-End\u00a0presentation and deployment on multiple devices. Here is a brief list of features and capabilities offered so far as GET arguments, useful for permalinks and\/or embed in external pages.<\/p>\n<hr \/>\n<p><strong>&#8220;ml&#8221;<\/strong>: define nodes (3D assets) to be loaded from the online collection.\u00a0For instance:<\/p>\n<ul>\n<li><code>ml=ref.osgjs<\/code><br \/>\nwill load the single node <em>&#8220;ref.osgjs&#8221;<\/em>\u00a0(basic coordinate system) &#8211; see <a href=\"http:\/\/seth.itabc.cnr.it\/services\/viewer.php?ml=ref.osgjs\" target=\"_blank\">here a live demo<\/a><\/li>\n<li><code>ml=mytest\/mymodel.osgjs<\/code><br \/>\nwill load the node <em>&#8220;mymodel.osgjs&#8221;<\/em> inside the subfolder <em>&#8220;mytest&#8221;<\/em><\/li>\n<\/ul>\n<p><em>Multiple<\/em> nodes can be grouped by <strong>&#8220;;&#8221;<\/strong> &#8211; Examples:<\/p>\n<ul>\n<li><code>ml=mytest\/modelA.osgjs;mytest\/modelB.osgjs<\/code><br \/>\nwill load both <em>modelA<\/em> and <em>modelB<\/em><\/li>\n<li><code>ml=mytest\/<\/code><br \/>\nis a\u00a0shorthand to load an entire folder and it will load all nodes contained in <em>&#8220;mytest&#8221;<\/em> sub-folder. Note the <strong>&#8220;\/&#8221;<\/strong> at the end<\/li>\n<\/ul>\n<hr \/>\n<p><strong>&#8220;pano&#8221;<\/strong>: loads a panoramic (equirectangular) image and attach to\u00a0on-the-fly spherical geometry. Examples:<\/p>\n<ul>\n<li><code>pano=mypano.jpg<\/code><br \/>\nwill load the equirectangular image &#8220;mypano.jpg&#8221; and attach to special sphere geometry &#8211; <a href=\"http:\/\/seth.itabc.cnr.it\/services\/viewer.php?pano=faug.jpg\" target=\"_blank\">live demo<\/a><\/li>\n<\/ul>\n<p>Notice you can have\u00a0three different\u00a0scenarios for interactive exploration:<\/p>\n<ol>\n<li>3D models only (<em>&#8220;ml&#8221;<\/em> provided but no <em>&#8220;pano&#8221;<\/em> option provided)<\/li>\n<li>Spherical panorama only (only <em>&#8220;pano&#8221;<\/em> argument provided)<\/li>\n<li>Both 3D models + spherical panorama (<em>&#8220;pano&#8221;<\/em> and <em>&#8220;ml&#8221;<\/em> both provided)<\/li>\n<\/ol>\n<hr \/>\n<p><strong>&#8220;alpha&#8221;<\/strong>:\u00a0enables a transparent background. This is useful when embedding the component in external web pages for styling purposes.\u00a0Here is a demo with <em>&#8220;ref.osgjs&#8221;<\/em>:\u00a0<a href=\"http:\/\/seth.itabc.cnr.it\/services\/viewer.php?ml=ref.osgjs&amp;alpha\" target=\"_blank\">viewer.php?ml=ref.osgjs&amp;alpha<\/a>\u00a0&#8211; Notice how the background is now white. Try embedding it in another web page with its own background to see the blending.<\/p>\n<hr \/>\n<p><strong>&#8220;pov&#8221;<\/strong>: tells the Front-End to load a starting <em>POV<\/em> (Point-of-View) by using smooth camera transition. The POV string is composed by 6 values encapsulating eye (x, y, z) and target (tx, ty, tz) positions. Examples:<\/p>\n<ul>\n<li><code>pov=-1.674 -2.996 1.159 -1.733 2.900 0.121<\/code><br \/>\nwill first load assets (a panoramic image and\/or 3D models)\u00a0and then load the\u00a0POV &#8211; <a href=\"http:\/\/seth.itabc.cnr.it\/services\/viewer.php?ml=ref.osgjs&amp;pov=-1.674 -2.996 1.159 -1.733 2.900 0.121\" target=\"_blank\">live demo<\/a><\/li>\n<\/ul>\n<p>The Front-End of course provides shortcuts to provide user with current POV, thus allowing to share the current 3D scene <strong>and<\/strong> a specific camera position<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a bit more technical post about customizing the main PHP component, responsible for main HTML5\/js Front-End\u00a0presentation and deployment on multiple devices. Here is a brief list of features and capabilities offered so far as GET arguments, useful for permalinks and\/or embed in external pages. &#8220;ml&#8221;: define nodes (3D assets) to be loaded from &#8230; <a title=\"Customizing the WebGL Front-End\" class=\"read-more\" href=\"https:\/\/osiris.itabc.cnr.it\/scenebaker\/index.php\/2015\/08\/23\/customizing-the-webgl-front-end\/\" aria-label=\"More on Customizing the WebGL Front-End\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":82,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6,4],"tags":[14,8],"_links":{"self":[{"href":"https:\/\/osiris.itabc.cnr.it\/scenebaker\/index.php\/wp-json\/wp\/v2\/posts\/37"}],"collection":[{"href":"https:\/\/osiris.itabc.cnr.it\/scenebaker\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/osiris.itabc.cnr.it\/scenebaker\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/osiris.itabc.cnr.it\/scenebaker\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/osiris.itabc.cnr.it\/scenebaker\/index.php\/wp-json\/wp\/v2\/comments?post=37"}],"version-history":[{"count":23,"href":"https:\/\/osiris.itabc.cnr.it\/scenebaker\/index.php\/wp-json\/wp\/v2\/posts\/37\/revisions"}],"predecessor-version":[{"id":78,"href":"https:\/\/osiris.itabc.cnr.it\/scenebaker\/index.php\/wp-json\/wp\/v2\/posts\/37\/revisions\/78"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/osiris.itabc.cnr.it\/scenebaker\/index.php\/wp-json\/wp\/v2\/media\/82"}],"wp:attachment":[{"href":"https:\/\/osiris.itabc.cnr.it\/scenebaker\/index.php\/wp-json\/wp\/v2\/media?parent=37"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/osiris.itabc.cnr.it\/scenebaker\/index.php\/wp-json\/wp\/v2\/categories?post=37"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/osiris.itabc.cnr.it\/scenebaker\/index.php\/wp-json\/wp\/v2\/tags?post=37"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}