main
Fabien Benetou 2 years ago
parent 0dba73fa8f
commit 110b547679
  1. 33
      get_local_aframe
  2. 25
      get_local_naf
  3. 29
      get_local_troika

@ -0,0 +1,33 @@
#!/bin/bash
SRC=aframe-local.min.js
wget https://aframe.io/releases/1.4.0/aframe.min.js -O $SRC
sed -i "s|https://cdn.aframe.io/fonts|local-fonts|" $SRC
mkdir local-fonts
wget https://cdn.aframe.io/fonts/Roboto-msdf.png
wget https://cdn.aframe.io/fonts/Roboto-msdf.json
mv Roboto-msdf.png local-fonts/
mv Roboto-msdf.json local-fonts/
mkdir local-models
wget https://cdn.aframe.io/controllers/oculus-hands/v4/left.glb
wget https://cdn.aframe.io/controllers/oculus-hands/v4/right.glb
mv left.glb right.glb local-models/
sed -i "s|https://cdn.aframe.io/controllers/oculus-hands/v4|local-models|g" $SRC
cat > local-aframe-test.html << EOF
<html>
<head>
<script src="$SRC"></script>
</head>
<body>
<a-scene>
<a-entity position="0.5 1.6 -1" text="value: Hello local World;"></a-entity>
<a-box position="-1 0.5 -3" rotation="0 45 0" color="#4CC3D9"></a-box>
<a-sphere position="0 1.25 -5" radius="1.25" color="#EF2D5E"></a-sphere>
<a-cylinder position="1 0.75 -3" radius="0.5" height="1.5" color="#FFC65D"></a-cylinder>
<a-plane position="0 0 -4" rotation="-90 0 0" width="4" height="4" color="#7BC8A4"></a-plane>
<a-sky color="#ECECEC"></a-sky>
</a-scene>
</body>
</html>
EOF
# to test : python3 -m http.server
# to clean up : rm -rf local-fonts local-models local-aframe-test.html $SRC

@ -0,0 +1,25 @@
#!/bin/bash
FILE=offline.html
AFRAME=aframe-local.min.js
if [ ! -f "$AFRAME" ]; then
echo "$AFRAME does not exist. Make sure to run get-local-aframe first"
exit
fi
git clone --depth 1 https://github.com/networked-aframe/networked-aframe
cd networked-aframe/
cp package-glitch.json package.json
npm i
cd examples/
mkdir offline
cd offline/
wget $(grep 'script src="https' ../basic.html | grep -v aframe.min.js | sed "s/.*\(https.*\)\".*/\1/")
cd ..
cp -r ../../$AFRAME ../../local-fonts ../../local-models offline/
cp basic.html $FILE
sed "s/https.*aframe.min.js/offline\/aframe-local.min.js/" -i $FILE
sed "s/script src=\"https:.*[^<]\//script src=\"offline\//" -i $FILE
cd ..
echo "to test run : cd networked-aframe && node server/easyrtc-server.js"
echo "then visit http://localhost:8080/$FILE"

@ -0,0 +1,29 @@
#!/bin/bash
SRC=aframe-troika-text-local.min.js
# to test : python3 -m http.server
# to clean up : rm -rf local-troika-fonts local-troika-test.html $SRC
wget https://unpkg.com/aframe-troika-text/dist/aframe-troika-text.min.js -O $SRC
sed -i "s|https://fonts.gstatic.com/s/roboto/v18/KFOmCnqEu92Fr1Mu4mxM.woff|local-troika-fonts/roboto.woff|" $SRC
mkdir local-troika-fonts
wget https://fonts.gstatic.com/s/roboto/v18/KFOmCnqEu92Fr1Mu4mxM.woff -O roboto.woff
mv roboto.woff local-troika-fonts/
cat > local-troika-test.html << EOF
<head>
<title>My A-Frame Scene</title>
<script src="aframe-local.min.js"></script>
<script src="$SRC"></script>
</head>
<body>
<a-scene>
<!-- As a component: -->
<a-entity position="0 1.6 -1" troika-text="value: Hello world!"></a-entity>
<!-- As a primitive: -->
<a-troika-text position="0 1.8 -1" value="Hello world!"></a-troika-text>
<a-sky color="darkblue"></a-sky>
</a-scene>
</body>
EOF
Loading…
Cancel
Save