Added php for parameter of resolution of sphere in stream

This commit is contained in:
Thomas FORGIONE
2015-04-08 17:26:02 +02:00
parent 566f42f5dc
commit 5c9390da90
3 changed files with 31 additions and 4 deletions

View File

@@ -21,7 +21,31 @@
<script src="/js/CameraContainer.js"></script>
<script src="/js/Tools.js"></script>
<script src="/js/ProgressiveSphere.js"></script>
<?php
// Set global variables
$default = 5;
$res = null;
try
{
if (isset($_GET['res']))
{
$res = intval($_GET['res']);
if ($res < 1 || $res > 25)
{
throw new Exception('Variable res not set');
}
}
else
{
throw new Exception('Variable res not set');
}
}
catch (Exception $e)
{
$res = $default;
}
echo "<script>var global_array = {res: " . $res . "};</script>\n";
?>
<script src="js/main.js"></script>
</body>
</html>

View File

@@ -46,7 +46,7 @@ function init() {
// Load the scene
loader = new THREE.OBJLoader();
sphere = new ProgessiveSphere(loader);
sphere = new ProgessiveSphere(loader, global_array.res);
plane = new Plane(1000,1000);
plane.translate(0,0,-100);