{% extends 'layoutFreeworld3d.html.twig' %}
{% block page_contents %}
{% for message in app.flashes('notice') %}
<div class="flash-notice">
<div class='notice'>{{ message }}</div>
</div>
{% endfor %}
{% for message in app.flashes('error') %}
<div class="flash-error">
<div class='error'>{{ message }}</div>
</div>
{% endfor %}
<!-- X3D -->
<div style="width: 100vw; height: 90vh; display:block; right:0; left:0; box-sizing: border-box; position: absolute; left: 0; right: 0; background-color: Black;" id="x3d" class="x3d_container">
<!-- menu -->
<div style="position: absolute; left: 0px; width: 73px; height: 100%; display:block; border-right: 1px solid #2299C6; background-color: #222; opacity: 0.8; text-align:center; font-family: helvetica, sans-serif; font-weight: bold; font-size: 10px; color: Silver; padding-top:5px; z-index: 3;" id="x3d_menu">
<div>X3D menu</div>
<div style="margin-top:1px" id="x3d_menu_viewpoint_home">
<button id="button_viewpoint_home" onclick="changeViewpoint('x3d_viewpoint_home')" style="font-family: helvetica, sans-serif; font-weight: normal; font-size: 10px; background-color: black; border: 1px solid #333; color: white;padding:2px; background-image: url( '/images/x3dmenu_home.png' ); background-size: 65px 65px; height: 67px; width: 67px;" title="Home Viewpoint"></button>
</div>
<div style="margin-top:2px" id="x3d_menu_viewpoint_menu">
<button id="button_viewpoint_menu" onclick="changeViewpoint('x3d_viewpoint_menu')" style="font-family: helvetica, sans-serif; font-weight: normal; font-size: 10px; background-color: black; border: 1px solid #333; color: white;padding:2px; background-image: url( '/images/x3dmenu_menu.png' ); background-size: 65px 65px; height: 67px; width: 67px;" title="Menu Viewpoint"></button>
</div>
<span style="margin-top:3px;margin-right:1px" id="x3d_menu_fullscreen">
<button id="button_fullscreen" style="font-family: helvetica, sans-serif; font-weight: normal; font-size: 10px; background-color: black; border: 1px solid #333; color: white;padding:2px; background-image: url( '/images/x3dmenu_fullscreen.png' ); background-size: 31px 31px; height: 33px; width: 33px;" title="full screen"></button>
</span>
<span style="margin-top:3px" id="x3d_menu_defaultscreen">
<button id="button_defaultscreen" onclick="sceneResize('normal')" style="font-family: helvetica, sans-serif; font-weight: normal; font-size: 10px; background-color: black; border: 1px solid #333; color: white;padding:2px; background-image: url( '/images/x3dmenu_defaultscreen.png' ); background-size: 31px 31px; height: 33px; width: 33px;" title="default screen"></button>
</span>
<!--
<div style="margin-top:7px" id="x3d_menu_viewpoint_1">
<button id="button_viewpoint_1" onclick="changeViewpoint('x3d_viewpoint_1')" style="font-family: helvetica, sans-serif; font-weight: normal; font-size: 10px; background-color: black; border: 1px solid #333; color: white;padding:2px; background-image: url( '/images/x3dmenu_eye.png' ); background-size: 31px 31px; height: 33px; width: 33px;" title="viewpoint 1"></button>
</div>
<div style="margin-top:7px" id="x3d_menu_viewpoint_2">
<button id="button_viewpoint_2" onclick="changeViewpoint('x3d_viewpoint_2')" style="font-family: helvetica, sans-serif; font-weight: normal; font-size: 10px; background-color: black; border: 1px solid #333; color: white;padding:2px; background-image: url( '/images/x3dmenu_eye.png' ); background-size: 31px 31px; height: 33px; width: 33px;" title="viewpoint 2"></button>
</div>
<div style="margin-top:7px" id="x3d_menu_viewpoint_3">
<button id="button_viewpoint_3" onclick="changeViewpoint('x3d_viewpoint_3')" style="font-family: helvetica, sans-serif; font-weight: normal; font-size: 10px; background-color: black; border: 1px solid #333; color: white;padding:2px; background-image: url( '/images/x3dmenu_eye.png' ); background-size: 31px 31px; height: 33px; width: 33px;" title="viewpoint 3"></button>
</div>
-->
</div>
{% if app.request.get('navigationInfoType') is defined and app.request.get('navigationInfoType') != '' %}
{% set navigationInfoType = app.request.get('navigationInfoType') %}
{% else %}
{% set navigationInfoType = "FLY" %}
{% endif %}
<x3d width='100%' height="90vh" id="x3d_section" style="height: 90vh; border-bottom: 2px solid #EA5B0C;background-color: #222;">
<scene id="x3d_scene">
<navigationInfo type='"{{ navigationInfoType }}"' id="navType"></navigationInfo>
<viewpoint orientation='0 1 0 -0' position='0 3 12' id='x3d_viewpoint_1'></viewpoint>
<viewpoint orientation='0 1 0 0' position='0 3 3' id='x3d_viewpoint_2'></viewpoint>
<viewpoint orientation='0 1 0 0.5' position='-10 3 -13' id='x3d_viewpoint_3'></viewpoint>
<viewpoint orientation='0 1 0 -0' position='0 3 11' id='x3d_viewpoint_home'></viewpoint>
<viewpoint orientation='0 1 0 0' position='0 3 5' id='x3d_viewpoint_menu'></viewpoint>
<DirectionalLight ambientIntensity='0.835991' direction='0.584419 0.286636 0.75914'></DirectionalLight>
<Background groundColor='0.2 0.2 0 0.3 0.3 0 0.5 0.5 0.3 0.1 0.3 0.4 0 0.2 0.4' skyAngle='0.04 0.05 0.1 1.309 1.570' skyColor='0.8 0.8 0.2 0.8 0.8 0.2 0.1 0.1 0.6 0.1 0.1 0.6 0.1 0.25 0.8 0.6 0.6 0.9'></Background>
{% if freeWorld3D.preferredPosition is defined %}
{% set preferredPosition = freeWorld3D.preferredPosition %}
{% else %}
{% set preferredPosition = '0 0 0' %}
{% endif %}
{% if freeWorld3D.preferredRotation is defined %}
{% set preferredRotation = freeWorld3D.preferredRotation %}
{% else %}
{% set preferredRotation = '0 1 0 0' %}
{% endif %}
<!-- FreeWorld X3D -->
<Transform DEF = 'FreeWorldX3D'
translation = '{{ preferredPosition }}'
scale = '1 1 1'
rotation='{{ preferredRotation }}'>
<Inline nameSpaceName="FreeWorld" mapDEFToID="true" url="{{ freeWorld3D.xmlFile|raw }}"></Inline>
</Transform>
</scene>
</x3d>
</div>
{% endblock %}