-
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
0 parents
commit 60df700
Showing
7 changed files
with
998 additions
and
0 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,2 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto |
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 @@ | ||
node_modules |
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,2 @@ | ||
# daily-dashboard | ||
|
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,13 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>threeJS-FinanceIO</title> | ||
<style> | ||
body { margin: 0; } | ||
</style> | ||
</head> | ||
<body> | ||
<script type="module" src="/main.ts"></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,73 @@ | ||
import * as THREE from 'three'; | ||
// @ts-ignore | ||
import { OrbitControls } from 'three/addons/controls/OrbitControls.js'; | ||
|
||
let camera: THREE.OrthographicCamera; | ||
let controls: any; | ||
let scene: THREE.Scene; | ||
let renderer: THREE.Renderer; | ||
|
||
async function init() { | ||
// setup scene and renderer | ||
scene = new THREE.Scene(); | ||
renderer = new THREE.WebGLRenderer({ antialias: true }); | ||
renderer.setSize(window.innerWidth, window.innerHeight); | ||
document.body.appendChild(renderer.domElement); | ||
|
||
// Set up an OrthographicCamera | ||
const aspect = window.innerWidth / window.innerHeight; | ||
const frustumSize = 100; | ||
camera = new THREE.OrthographicCamera( | ||
frustumSize * aspect / - 2, // left | ||
frustumSize * aspect / 2, // right | ||
frustumSize / 2, // top | ||
frustumSize / - 2, // bottom | ||
0.1, // near | ||
1000 // far | ||
); | ||
camera.position.set(0, 100, 100); // Position the camera | ||
camera.lookAt(0, 0, 0); // Look at the center of the scene | ||
|
||
// Adding a flat plane | ||
const geometry = new THREE.PlaneGeometry(200, 200); | ||
const material = new THREE.MeshBasicMaterial({ color: 0x00ff00, side: THREE.DoubleSide }); | ||
const plane = new THREE.Mesh(geometry, material); | ||
plane.rotation.x = Math.PI / 2; // Rotate the plane to lie flat | ||
scene.add(plane); | ||
|
||
// show axis | ||
const axesHelper = new THREE.AxesHelper(5000); | ||
axesHelper.setColors('#fc0303', '#036ffc', '#03fc17') | ||
// scene.add(axesHelper); | ||
|
||
// setup orbitControls | ||
controls = new OrbitControls(camera, renderer.domElement); | ||
controls.enableDamping = true; | ||
controls.dampingFactor = 0.25; | ||
controls.screenSpacePanning = false; | ||
controls.maxPolarAngle = Math.PI / 2; | ||
controls.target = new THREE.Vector3(1, 1, 1) | ||
|
||
// setup light | ||
const hemiLight = new THREE.HemisphereLight(0xffffbb, 0x080820, 0.3); | ||
scene.add(hemiLight); | ||
const light = new THREE.DirectionalLight(0xffffff, 1); | ||
light.position.set(0, 1, 1).normalize(); | ||
scene.add(light); | ||
|
||
} | ||
|
||
|
||
function animate() { | ||
requestAnimationFrame(animate); | ||
render() | ||
} | ||
|
||
function render() { | ||
renderer.render(scene, camera); | ||
} | ||
|
||
|
||
init().then(() => { | ||
animate(); | ||
}) |
Oops, something went wrong.