Skip to content

Commit

Permalink
Remade
Browse files Browse the repository at this point in the history
  • Loading branch information
TheProlifical committed Jun 24, 2024
1 parent cbabae4 commit f9dd365
Show file tree
Hide file tree
Showing 27 changed files with 297 additions and 1,233 deletions.
Binary file removed README.md
Binary file not shown.
1 change: 0 additions & 1 deletion a

This file was deleted.

16 changes: 0 additions & 16 deletions animation.js

This file was deleted.

94 changes: 47 additions & 47 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
import * as THREE from 'three';
import { GLTFLoader } from 'three/examples/loaders/GLTFLoader.js';

function main() {
let camera, scene, renderer;
let mouseX = 0, mouseY = 0;

init();
animate();

function init() {
renderer = new THREE.WebGLRenderer();
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);

scene = new THREE.Scene();
camera = new THREE.PerspectiveCamera(65, window.innerWidth / window.innerHeight, 0.1, 1000);
camera.position.set(0, 0, 5);

const loader = new GLTFLoader();
loader.load('./night_sky_visible_spectrum_monochromatic.glb', function (gltf) {
scene.add(gltf.scene);
}, undefined, function (error) {
console.error('An error happened:', error);
alert('Failed to load the 3D model.');
});

const light = new THREE.PointLight(0xffffff, .001);
light.position.set(5, 5, 5);
scene.add(light);

document.addEventListener('mousemove', onDocumentMouseMove, false);
}

function onDocumentMouseMove(event) {
mouseX = (event.clientX / window.innerWidth) * 2 - 1;
mouseY = -(event.clientY / window.innerHeight) * 2 + 1;
}

function animate() {
requestAnimationFrame(animate);
camera.lookAt(new THREE.Vector3(mouseX * 5, mouseY * 5, 0));
renderer.render(scene, camera);
}
}

main();
import * as THREE from 'three';
import { GLTFLoader } from 'three/examples/loaders/GLTFLoader.js';

function main() {
let camera, scene, renderer;
let mouseX = 0, mouseY = 0;

init();
animate();

function init() {
renderer = new THREE.WebGLRenderer();
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);

scene = new THREE.Scene();
camera = new THREE.PerspectiveCamera(65, window.innerWidth / window.innerHeight, 0.1, 1000);
camera.position.set(0, 0, 5);

const loader = new GLTFLoader();
loader.load('./night_sky_visible_spectrum_monochromatic.glb', function (gltf) {
scene.add(gltf.scene);
}, undefined, function (error) {
console.error('An error happened:', error);
alert('Failed to load the 3D model.');
});

const light = new THREE.PointLight(0xffffff, .001);
light.position.set(5, 5, 5);
scene.add(light);

document.addEventListener('mousemove', onDocumentMouseMove, false);
}

function onDocumentMouseMove(event) {
mouseX = (event.clientX / window.innerWidth) * 2 - 1;
mouseY = -(event.clientY / window.innerHeight) * 2 + 1;
}

function animate() {
requestAnimationFrame(animate);
camera.lookAt(new THREE.Vector3(mouseX * 5, mouseY * 5, 0));
renderer.render(scene, camera);
}
}

main();
75 changes: 0 additions & 75 deletions articles.css

This file was deleted.

149 changes: 0 additions & 149 deletions articles.html

This file was deleted.

10 changes: 0 additions & 10 deletions blog.xml

This file was deleted.

File renamed without changes
40 changes: 0 additions & 40 deletions drawing.css

This file was deleted.

Loading

0 comments on commit f9dd365

Please sign in to comment.