Skip to content

Instantly share code, notes, and snippets.

@yuripourre
Last active February 24, 2024 22:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save yuripourre/d56859c23911c494f74ae320b5b068ea to your computer and use it in GitHub Desktop.
Save yuripourre/d56859c23911c494f74ae320b5b068ea to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Basketball Prototype</title>
<script src="https://aframe.io/releases/1.0.4/aframe.min.js"></script>
<script src="//cdn.rawgit.com/donmccurdy/aframe-physics-system/v4.0.1/dist/aframe-physics-system.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/donmccurdy/aframe-extras@v6.1.0/dist/aframe-extras.min.js"></script>
<script src="https://d3js.org/d3.v4.min.js"></script>
</head>
<body>
<!-- Moon gravity -->
<a-scene physics="gravity: -9.8" renderer="antialias: true">
<!-- Player -->
<a-entity camera look-controls wasd-controls></a-entity>
<a-entity
id="leftController"
static-body="shape: sphere; sphereRadius: 0.02;"
oculus-touch-controls="hand: left"
sphere-collider="objects: .throwable"
grab
></a-entity>
<a-entity
id="rightController"
static-body="shape: sphere; sphereRadius: 0.02;"
oculus-touch-controls="hand: right"
sphere-collider="objects: .throwable"
grab
></a-entity>
<!-- Sky -->
<a-sky color="#87CEEB"></a-sky>
<!-- Ground -->
<a-plane
static-body
rotation="-90 0 0"
width="10"
height="10"
color="#666666"
></a-plane>
<!-- Balls -->
<a-sphere
class="throwable"
dynamic-body
position="0 0.25 -0.5"
radius="0.12"
color="red"
></a-sphere>
<a-sphere
class="throwable"
dynamic-body
position="0.25 0.25 -0.5"
radius="0.12"
color="red"
></a-sphere>
<a-sphere
class="throwable"
dynamic-body
position="-0.25 0.25 -0.5"
radius="0.12"
color="red"
></a-sphere>
<!-- Basketball Backboard -->
<a-box
static-body
position="0 2 -2.5"
width="2"
height="1"
depth="0.1"
color="grey"
></a-box>
<!-- Basketball Hoop -->
<!--<a-torus static-body color="#FF3333" arc="360" radius="0.5" radius-tubular="0.01" position="0 0.8 -1.4" rotation="90 0 0"></a-torus>-->
<!-- Left Part -->
<a-box static-body
color="red"
position="-0.3 1.8 -2"
width="0.01"
height="0.01"
depth="0.6"></a-box>
<!-- Right Part -->
<a-box static-body
color="red"
position="0.3 1.8 -2"
width="0.01"
height="0.01"
depth="0.6"></a-box>
<!-- Far Part -->
<a-box static-body
color="red"
position="0 1.8 -2.3"
width="0.6"
height="0.01"
depth="0.01"></a-box>
<!-- Close Part -->
<a-box static-body
color="red"
position="0 1.8 -1.7"
width="0.6"
height="0.01"
depth="0.01"></a-box>
</a-scene>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment