Skip to content

Some Virtual Reality Web Work #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions 4-VirtualRealityWeb/virtReal.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!doctype html>
<!--
LET'S GET MOVING!
In this example we will make a moving entity!
Can you make a sphere following a moving cube instead?
-->
<html>
<head>
<title>Movement</title>
<script src="https://aframe.io/releases/latest/aframe.min.js"></script>
</head>
<body>

<a-scene>
<a-sky color="blue"></a-sky>
<!-- A camera -->
<a-camera id="camera" position="0 1.8 4"></a-camera>

<!-- A target entity -->
<a-sphere id="target" color="#404040" radius="0.5">
<a-animation attribute="position" from="-12 6 -12" to="8 3 -2" dur="1500" repeat="indefinite" fill="forwards" direction="alternate"></a-animation>
</a-sphere>

<!-- Entities look at the target -->
<a-cube width="1" depth="1" height="1" color="#4CC3D9" look-at="#target" position="-4 0 -2"></a-cube>
<a-cylinder radius="0.6" height="2" color="#7BC8A4" look-at="#target" position="0 0 -2"></a-cylinder>
<a-cube width="0.5" depth="1" height="2" color="#F16745" look-at="#target" position="4 0 -2"></a-cube>
<a-cylinder radius="0.2" height="2" color="#7BC8A4" look-at="#target" position="-4 0 1"></a-cylinder>
<a-cube width="2" depth="1" height="0.25" color="#93648D" look-at="#target" position="0 0 1"></a-cube>
<a-cube width="1" depth="2" height="0.5" color="#999" look-at="#target" position="4 0 1"></a-cube>

<!-- This entity looks at the camera. Use WASD controls to test it -->
<a-cube width="2" depth="2" height="2" color="#FFC65D" look-at="#camera" position="-6 2.5 -2"></a-cube>

<a-image position="0 -1.2 0" src="../_images/radial-highlight-1.png" rotation="-90 0 0" scale="10 10 10"></a-image>

</a-scene>

</body>
</html>
20 changes: 20 additions & 0 deletions 4-VirtualRealityWeb/vr.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

<html>
<head>
<script src="https://aframe.io/releases/0.9.2/aframe.min.js"></script>
</head>
<body>
<a-scene>
<a-cylinder position="1 0.75 -3" radius="0.4" height="1.5" color="#FFC65D"></a-cylinder>
<a-cylinder position="-1 0.75 -3" radius="0.4" height="1.5" color="#FFC65D"></a-cylinder>
<a-box position="0 2 -2.5" rotation="0 45 0" color="#4CC3D9"></a-box>
<a-sphere position="0 4.5 -4" radius="1.15" color="#EF2D5E"></a-sphere>

<a-cylinder position="1 2.75 -3" radius="0.25" height="1" color="#FFC65D"></a-cylinder>
<a-cylinder position="-1 2.75 -3" radius="0.25" height="1" color="#FFC65D"></a-cylinder>
<a-plane position="0 0 -4" rotation="-90 0 0" width="4" height="4" color="#7BC8A4"></a-plane>


</a-scene>
</body>
</html>