Skip to content

Commit

Permalink
Should be good
Browse files Browse the repository at this point in the history
  • Loading branch information
chritoto committed Feb 16, 2024
1 parent 54305f0 commit 8a17c09
Show file tree
Hide file tree
Showing 11 changed files with 226 additions and 3 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file added splats/gabriel_mod.ply
Binary file not shown.
Binary file added splats/groupe2_mod.ply
Binary file not shown.
Binary file added splats/groupe3_2_mod.ply
Binary file not shown.
Binary file added splats/groupe3_mod.ply
Binary file not shown.
Binary file modified splats/groupe_mod.ply
Binary file not shown.
38 changes: 35 additions & 3 deletions splats/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
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")
{
Expand Down Expand Up @@ -80,6 +83,7 @@
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")
Expand All @@ -88,6 +92,7 @@
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")
Expand All @@ -96,8 +101,18 @@
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');
}
}
);

Expand All @@ -112,20 +127,31 @@
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');
}
}
Expand All @@ -141,6 +167,8 @@
<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>
Expand All @@ -149,10 +177,14 @@
<!-- <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="G1" gaussian_splatting="src: topo_mod.ply;" rotation="0 0 0" position="16.4 2.1 -16.9" scale="48 48 48" visible="true"></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="G1" 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="G3" gaussian_splatting="src: algues_mod.ply;" rotation="0 0 0" position="2.4 -1.1 6.9" 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="43.4 -2.8 20.7" scale="32 32 32" visible="false"></a-entity>
<!-- <a-entity id="G1" gaussian_splatting="src: groupe2mod.ply;" rotation="0 0 0" position="4.8 0.8 4.1" scale="10 10 10" visible="true"></a-entity> -->
<!-- <a-entity id="G3" 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="G4" 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>
Expand Down
191 changes: 191 additions & 0 deletions splats/index2.html
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 added splats/neige_mod.ply
Binary file not shown.
Binary file added splats/sky7_mod.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added splats/sky8_mod.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8a17c09

Please sign in to comment.