Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Organized project directory structure #23

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions favicon.svg

This file was deleted.

18 changes: 1 addition & 17 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,23 +82,7 @@ <h3>Taco Bell</h3>

</main>

<script type="module" src="/main.js"></script>
















<script type="module" src="./src/main.js"></script>

</body>
</html>
144 changes: 87 additions & 57 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
12 changes: 8 additions & 4 deletions main.js → src/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import './style.css';
import * as THREE from 'three';
import Jeff from './assets/jeff.png'
import Space from './assets/space.jpg'
import Moon from './assets/moon.jpg';
import Normal from './assets/normal.jpg';
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls';

// Setup
Expand Down Expand Up @@ -60,21 +64,21 @@ Array(200).fill().forEach(addStar);

// Background

const spaceTexture = new THREE.TextureLoader().load('space.jpg');
const spaceTexture = new THREE.TextureLoader().load(Space);
scene.background = spaceTexture;

// Avatar

const jeffTexture = new THREE.TextureLoader().load('jeff.png');
const jeffTexture = new THREE.TextureLoader().load(Jeff);

const jeff = new THREE.Mesh(new THREE.BoxGeometry(3, 3, 3), new THREE.MeshBasicMaterial({ map: jeffTexture }));

scene.add(jeff);

// Moon

const moonTexture = new THREE.TextureLoader().load('moon.jpg');
const normalTexture = new THREE.TextureLoader().load('normal.jpg');
const moonTexture = new THREE.TextureLoader().load(Moon);
const normalTexture = new THREE.TextureLoader().load(Normal);

const moon = new THREE.Mesh(
new THREE.SphereGeometry(3, 32, 32),
Expand Down
File renamed without changes.