Skip to content

Commit

Permalink
create example data file
Browse files Browse the repository at this point in the history
  • Loading branch information
wpowers42 committed Sep 17, 2023
1 parent ca54b83 commit c815899
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 24 deletions.
1 change: 1 addition & 0 deletions simulations/sandbox/exampleData.js

Large diffs are not rendered by default.

34 changes: 10 additions & 24 deletions simulations/index.html → simulations/sandbox/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,17 @@
</head>

<body>
<!-- <script src="https://cdn.jsdelivr.net/gh/paulmasson/threejs-with-controls@r121/build/three.min.js"></script> -->
<script async src="https://unpkg.com/es-module-shims@1.8.0/dist/es-module-shims.js"></script>

<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/three@0.156.1/build/three.module.js",
"three/addons/": "https://unpkg.com/three@0.156.1/examples/jsm/"
{
"imports": {
"three": "https://unpkg.com/three@0.156.1/build/three.module.js",
"three/addons/": "https://unpkg.com/three@0.156.1/examples/jsm/"
}
}
}
</script>
<script src="data.js"></script>
</script>
<script src="exampleData.js"></script>
<script type="module">
document.addEventListener('contextmenu', event => event.preventDefault());

Expand Down Expand Up @@ -230,23 +229,10 @@
y: (boundary.min[1] + boundary.max[1]) / 2,
z: (boundary.min[2] + boundary.max[2]) / 2
};
// const controls = new THREE.OrbitControls(camera, renderer.domElement);
const controls = new PointerLockControls(camera, renderer.domElement);

// controls.enablePan = false;

// camera.position.set(midPoint.x, midPoint.y, midPoint.z);
camera.position.set(-30, 20, 30);
// controls.target = new THREE.Vector3(midPoint.x, 0, midPoint.z);

// Set min and max zoom (distance to the lookAt point).
// controls.minDistance = 10; // e.g. camera can't get closer than 10 units to the lookAt point
// controls.maxDistance = 50; // e.g. camera can't get further than 50 units from the lookAt point

// Set min and max polar angle (vertical orbit).
// controls.maxPolarAngle = Math.PI / 2; // e.g. camera can't go higher than 90 degrees (directly above) from the horizontal

// controls.update();
const controls = new PointerLockControls(camera, renderer.domElement);
camera.position.set(boundary.min[0], 15, boundary.min[2]);
camera.lookAt(midPoint.x, 1, midPoint.z);

// Lock the pointer when the right mouse button is down
renderer.domElement.addEventListener("mousedown", function (event) {
Expand Down

0 comments on commit c815899

Please sign in to comment.