-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
226 additions
and
3 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,191 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script src="aframe_min.js"></script> | ||
<!--<script src="https://quadjr.github.io/aframe-gaussian-splatting/index.js"></script>--> | ||
<!--<script src="https://electrum-bowie.github.io/index.js"></script>--> | ||
<script src="gaussian.js"></script> | ||
</head> | ||
<body> | ||
<script type="text/javascript"> | ||
console.log("L: move down, O: move up"); | ||
console.log("N: scale down, M: scale up"); | ||
document.addEventListener( "keydown", | ||
function(eventData) | ||
{ | ||
var gaussian = "G1"; | ||
if (document.getElementById('G2').getAttribute('visible') == true) { | ||
gaussian = "G2" | ||
} | ||
if (document.getElementById('G3').getAttribute('visible') == true) { | ||
gaussian = "G3" | ||
} | ||
if (document.getElementById('G4').getAttribute('visible') == true) { | ||
gaussian = "G4" | ||
} | ||
console.log(eventData.key.toUpperCase()); | ||
if (eventData.key.toUpperCase() == "L") | ||
{ | ||
position = document.getElementById(gaussian).getAttribute('position'); | ||
position.y = position.y - 0.1; | ||
console.log(position) | ||
} | ||
if (eventData.key.toUpperCase() == "O") | ||
{ | ||
position = document.getElementById(gaussian).getAttribute('position'); | ||
position.y = position.y + 0.1; | ||
console.log(position) | ||
} | ||
if (eventData.key.toUpperCase() == "W") | ||
{ | ||
position = document.getElementById(gaussian).getAttribute('position'); | ||
position.z = position.z + 0.1; | ||
console.log(position) | ||
} | ||
if (eventData.key.toUpperCase() == "S") | ||
{ | ||
position = document.getElementById(gaussian).getAttribute('position'); | ||
position.z = position.z - 0.1; | ||
console.log(position) | ||
} | ||
if (eventData.key.toUpperCase() == "D") | ||
{ | ||
position = document.getElementById(gaussian).getAttribute('position'); | ||
position.x = position.x - 0.1; | ||
console.log(position) | ||
} | ||
if (eventData.key.toUpperCase() == "A") | ||
{ | ||
position = document.getElementById(gaussian).getAttribute('position'); | ||
position.x = position.x + 0.1; | ||
console.log(position) | ||
} | ||
if (eventData.key.toUpperCase() == "N") | ||
{ | ||
scale = document.getElementById(gaussian).getAttribute('scale'); | ||
scale.x = scale.x - 0.1; | ||
scale.y = scale.y - 0.1; | ||
scale.z = scale.z - 0.1; | ||
console.log(scale) | ||
} | ||
if (eventData.key.toUpperCase() == "M") | ||
{ | ||
scale = document.getElementById(gaussian).getAttribute('scale'); | ||
scale.x = scale.x + 0.1; | ||
scale.y = scale.y + 0.1; | ||
scale.z = scale.z + 0.1; | ||
console.log(scale) | ||
} | ||
|
||
if (eventData.key.toUpperCase() == "1") | ||
{ | ||
document.getElementById('master').setAttribute('scene', '1'); | ||
document.getElementById('G2').setAttribute('visible', 'false'); | ||
document.getElementById('G1').setAttribute('visible', 'true'); | ||
document.getElementById('G3').setAttribute('visible', 'false'); | ||
document.getElementById('G4').setAttribute('visible', 'false'); | ||
document.getElementById('sky').setAttribute('src', '#sky1'); | ||
} | ||
else if (eventData.key.toUpperCase() == "2") | ||
{ | ||
document.getElementById('master').setAttribute('scene', '2'); | ||
document.getElementById('G1').setAttribute('visible', 'false'); | ||
document.getElementById('G2').setAttribute('visible', 'true'); | ||
document.getElementById('G3').setAttribute('visible', 'false'); | ||
document.getElementById('G4').setAttribute('visible', 'false'); | ||
document.getElementById('sky').setAttribute('src', '#sky2'); | ||
} | ||
else if (eventData.key.toUpperCase() == "3") | ||
{ | ||
document.getElementById('master').setAttribute('scene', '3'); | ||
document.getElementById('G1').setAttribute('visible', 'false'); | ||
document.getElementById('G2').setAttribute('visible', 'false'); | ||
document.getElementById('G3').setAttribute('visible', 'true'); | ||
document.getElementById('G4').setAttribute('visible', 'false'); | ||
document.getElementById('sky').setAttribute('src', '#sky3'); | ||
} | ||
else if (eventData.key.toUpperCase() == "4") | ||
{ | ||
document.getElementById('master').setAttribute('scene', '4'); | ||
document.getElementById('G1').setAttribute('visible', 'false'); | ||
document.getElementById('G2').setAttribute('visible', 'false'); | ||
document.getElementById('G3').setAttribute('visible', 'false'); | ||
document.getElementById('G4').setAttribute('visible', 'true'); | ||
document.getElementById('sky').setAttribute('src', '#sky4'); | ||
} | ||
} | ||
); | ||
|
||
AFRAME.registerComponent('button-logging',{ | ||
init: function () { | ||
this.el.addEventListener('abuttondown', this.changeScene); | ||
}, | ||
changeScene: function (evt) { | ||
scene = document.getElementById('master').getAttribute('scene'); | ||
if (scene == "1") { | ||
document.getElementById('master').setAttribute('scene', '2'); | ||
document.getElementById('G1').setAttribute('visible', 'false'); | ||
document.getElementById('G2').setAttribute('visible', 'true'); | ||
document.getElementById('G3').setAttribute('visible', 'false'); | ||
document.getElementById('G4').setAttribute('visible', 'false'); | ||
document.getElementById('sky').setAttribute('src', '#sky2'); | ||
} | ||
else if (scene == "2") { | ||
document.getElementById('master').setAttribute('scene', '3'); | ||
document.getElementById('G2').setAttribute('visible', 'false'); | ||
document.getElementById('G1').setAttribute('visible', 'false'); | ||
document.getElementById('G3').setAttribute('visible', 'true'); | ||
document.getElementById('G4').setAttribute('visible', 'false'); | ||
document.getElementById('sky').setAttribute('src', '#sky3'); | ||
} | ||
else if (scene == "3") { | ||
document.getElementById('master').setAttribute('scene', '4'); | ||
document.getElementById('G2').setAttribute('visible', 'false'); | ||
document.getElementById('G1').setAttribute('visible', 'false'); | ||
document.getElementById('G3').setAttribute('visible', 'false'); | ||
document.getElementById('G4').setAttribute('visible', 'true'); | ||
document.getElementById('sky').setAttribute('src', '#sky4'); | ||
} | ||
else if (scene == "4") { | ||
document.getElementById('master').setAttribute('scene', '1'); | ||
document.getElementById('G2').setAttribute('visible', 'false'); | ||
document.getElementById('G1').setAttribute('visible', 'true'); | ||
document.getElementById('G3').setAttribute('visible', 'false'); | ||
document.getElementById('G4').setAttribute('visible', 'false'); | ||
document.getElementById('sky').setAttribute('src', '#sky1'); | ||
} | ||
} | ||
}); | ||
</script> | ||
<a-scene id="master" renderer="antialias: false" scene="1" reflection="directionalLight:a-light#dirlight;"stats> | ||
<a-entity oculus-touch-controls="hand: left" button-logging></a-entity> | ||
<a-entity oculus-touch-controls="hand: right" button-logging></a-entity> | ||
<a-assets> | ||
<img id="sky1" src="sky1_mod.png"> | ||
<img id="sky2" src="sky2_mod.png"> | ||
<img id="sky3" src="sky3_mod.png"> | ||
<img id="sky4" src="sky4_mod.png"> | ||
<img id="sky5" src="sky5_mod.png"> | ||
<img id="sky6" src="sky6_mod.png"> | ||
<img id="sky7" src="sky7_mod.png"> | ||
<img id="sky8" src="sky8_mod.png"> | ||
</a-assets> | ||
<a-sky id="sky" src="#sky1"></a-sky> | ||
<a-entity camera="active: true" look-controls position="0 1.6 0" ></a-entity> | ||
<a-entity position="0 0 0" > | ||
<!-- <a-sphere position="0 0 0" radius="41" color="#EF2D5E"></a-sphere> --> | ||
<!-- <a-box color="tomato" depth="2" height="0.1" width="10"></a-box> --> | ||
</a-entity> | ||
<!--<a-entity gaussian_splatting="src: https://huggingface.co/cakewalk/splat-data/resolve/main/train.splat;" rotation="0 0 0" position="0 1.5 -2"></a-entity>--> | ||
<!-- <a-entity id="G1" gaussian_splatting="src: topo_mod.ply;" rotation="0 0 0" position="-3.4 2.3 1.8" scale="48 48 48"></a-entity> --> | ||
<!-- <a-entity id="G2" gaussian_splatting="src: penguin_mod.ply;" rotation="0 0 0" position="1 -2.2 -2.1" scale="22 22 22" visible="false"></a-entity> --> | ||
<!-- <a-entity id="G3" gaussian_splatting="src: algues_mod.ply;" rotation="0 0 0" position="2.2 -0.3 3.1" scale="10.2 10.2 10.2" visible="false"></a-entity> --> | ||
<!-- <a-entity id="G4" gaussian_splatting="src: groupe_mod.ply;" rotation="0 0 0" position="1.2 0.8 1.3" scale="1 1 1" visible="true"></a-entity> --> | ||
<a-entity id="G1" gaussian_splatting="src: groupe2_mod.ply;" rotation="0 0 0" position="3.2 0.3 7.1" scale="25 25 25" visible="true"></a-entity> | ||
<a-entity id="G2" gaussian_splatting="src: groupe3_2_mod.ply;" rotation="0 0 0" position="4.2 0 -4.4" scale="10 10 10" visible="false"></a-entity> | ||
<a-entity id="G3" gaussian_splatting="src: neige_mod.ply;" rotation="0 0 0" position="-10 -6.4 -32" scale="33 33 33" visible="false"></a-entity> | ||
<a-entity id="G4" gaussian_splatting="src: gabriel_mod.ply;" rotation="0 0 0" position="4.6 -10.1 -24.1" scale="35 35 35" visible="false"></a-entity> | ||
</a-scene> | ||
|
||
</body> | ||
</html> |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.