-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
76,078 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/dist | ||
/.cache | ||
yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
<style> | ||
body { margin: 0; } | ||
canvas { width: 100%; height: 100% } | ||
</style> | ||
<title>three.js</title> | ||
</head> | ||
<body> | ||
<script src="./src/lib/three.js"></script> | ||
<script type="module" src="./src/lib/OrbitControls.js"></script> | ||
<script type="module" src="./src/lib/Physijs.js"></script> | ||
<script type="module" src="./index.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import camera from './src/camera.js'; | ||
import { addOnMouseDown } from './src/events.js'; | ||
import { addToList, addScore } from './src/operates.js'; | ||
import {createText} from './src/text.js'; | ||
|
||
window.onload = () => { | ||
Physijs.scripts.worker = './src/lib/physijs_worker.js'; | ||
Physijs.scripts.ammo = './ammo.js'; | ||
|
||
let scene = new Physijs.Scene(); | ||
scene.setGravity(new THREE.Vector3( 0, -50, 0 )) | ||
|
||
const render = new THREE.WebGLRenderer() | ||
render.setSize(window.innerWidth, window.innerHeight) | ||
document.body.appendChild(render.domElement) | ||
|
||
const axesHelper = new THREE.AxesHelper( 1000 ); | ||
scene.add( axesHelper ); | ||
|
||
// createText('score: ').then(scoreLabel => { | ||
// scene.add(scoreLabel) | ||
// scoreLabel.position.set(160, 150, -200) | ||
// }) | ||
|
||
|
||
|
||
const controls = new window.THREE.OrbitControls( camera, render.domElement ); | ||
|
||
const animate = () => { | ||
controls.update(); | ||
scene.simulate(); | ||
render.render(scene, camera) | ||
requestAnimationFrame(animate); | ||
} | ||
|
||
animate() | ||
} |
Binary file not shown.
Binary file not shown.
Oops, something went wrong.