Hi(gh)!
Am 02.04.2012 12:28, schrieb Joerg Scheurich aka MUFTI:
> Maybe you forgotten to serve the right MIME type in the HTTP-Header.
>
> E.g.
http://tecfa.unige.ch/guides/php/examples/vrml-temple/vrml.phps
>
> Starts with
>
> <? Header("Content-type: model/vrml");
> echo "#VRML V2.0 utf8";
> ?>
>
> Similary to this, you would need e.g. for X3DV something like
>
> <? Header("Content-type: model/x3d+vrml");
> echo "#X3D V3.0 utf8";
> echo "PROFILE Immersive";
> ?>
I tried your suggestion - but all I got was this:
Loading file: '
http://localhost/x3d/city.php'
X3DParser:: Error at line 0, position 0, 'Error document empty.'
WARNING: Unable to load file: '
http://localhost/x3d/city.php'
Here is my code:
<?php
header ("Content-type:model/x3d+xml");
// require("x3dheader.php");
// x3dheader("city.php", "Yadgar");
echo "#X3D V3.0 utf8";
echo "PROFILE Interchange";
$heights = array(3.5, 7, 11, 9.6, 7.4, 15.6, 12, 8.5, 21.5, 19.7,
14.5, 10.3, 8.1, 5.6, 4.5, 7.4);
?>
<Scene>
<!-- Datenbereich für den Szenengraph -->
<?
for ($i=0; $i<count($heights); $i++)
{
echo '<Transform translation="';
echo 0.5+2*($i%4);
echo " ";
echo $heights[$i]/2;
echo " ";
echo 0.5+2*(integer)($i/4);
echo '">';
echo "\n";
echo " <Shape>\n";
echo ' <Box size="';
echo 1;
echo " ";
echo $heights[$i];
echo " ";
echo 1;
echo '"/>';
echo "\n";
echo " </Shape>\n";
echo "</Transform>\n";
}
?>
</Scene>
</X3D>