adds prototype client, adds default NPC model placeholder (han head)
This commit is contained in:
parent
246a883f57
commit
fcfbcdeb0d
38
src/webserver/play/index.php
Normal file
38
src/webserver/play/index.php
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
$db_path = realpath(dirname(__FILE__) . '/../config/db.php');
|
||||||
|
require_once($db_path);
|
||||||
|
?>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>All Whomst Wander</title>
|
||||||
|
<script src="https://aframe.io/releases/1.3.0/aframe.min.js"></script>
|
||||||
|
<script type='text/javascript' src='https://raw.githack.com/AR-js-org/AR.js/master/three.js/build/ar-threex-location-only.js'></script>
|
||||||
|
<script type='text/javascript' src='https://raw.githack.com/AR-js-org/AR.js/master/aframe/build/aframe-ar.js'></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<a-scene vr-mode-ui='enabled: false' arjs='sourceType: webcam; videoTexture: true; debugUIEnabled: false' renderer='antialias: true; alpha: true'>
|
||||||
|
<a-camera gps-new-camera='gpsMinDistance: 5'></a-camera>
|
||||||
|
<?php
|
||||||
|
$poi_npc_results = $conn->query('SELECT * FROM "POI-NPCs"');
|
||||||
|
if ($poi_npc_results) {
|
||||||
|
while ($poi_npc = $poi_npc_results->fetchArray()) {
|
||||||
|
$poi_result = $conn->query('SELECT * FROM POIs WHERE id = ' . $poi_npc['poi_id']);
|
||||||
|
if ($poi_result) $poi = $poi_result->fetchArray();
|
||||||
|
$npc_result = $conn->query('SELECT * FROM NPCs WHERE id = ' . $poi_npc['npc_id']);
|
||||||
|
if ($npc_result) $npc = $npc_result->fetchArray();
|
||||||
|
?>
|
||||||
|
<a-entity gps-new-entity-place="latitude: <?= $poi['latitude'] ?>; longitude: <?= $poi['longitude'] ?>;">
|
||||||
|
<a-gltf-model src="<?= trim($npc['model_path']) === "" ? "models/head.gltf" : $npc['model_path'] ?>" position="0 0 0" rotation="0 0 0"></a-gltf-model>
|
||||||
|
<a-text look-at="[gps-new-camera]" scale="5 5 5" align="center" text="value: <?= $poi['name'] . "\n" . $npc['name'] ?>;"></a-text>
|
||||||
|
</a-entity>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</a-scene>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
115
src/webserver/play/models/head.gltf
Normal file
115
src/webserver/play/models/head.gltf
Normal file
File diff suppressed because one or more lines are too long
22820
src/webserver/play/models/head.obj
Normal file
22820
src/webserver/play/models/head.obj
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user