Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
c8e4 committed Oct 19, 2024
0 parents commit e2319f8
Show file tree
Hide file tree
Showing 9 changed files with 3,388 additions and 0 deletions.
88 changes: 88 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Node.js
node_modules
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Vite
dist
.vite
.cache

# MacOS
.DS_Store

# Editor Directories and Files
.idea
.vscode
*.sublime-project
*.sublime-workspace

# Logs
*.log

# Temporary files and builds
*.tmp
*.temp
*.swp
*.pid
*.seed
*.bak
*.orig

# ESLint
.eslintcache

# Output of build tools
out/
build/
coverage/

# NPM packages
*.tgz

# JetBrains IDE
*.iml
.idea/

# Windows
Thumbs.db
ehthumbs.db

# Svelte/Vite HMR
.svelte-kit

# Miscellaneous
*.local
.env.local
.env.*.local

# Private keys and sensitive files
.env
.env.*
*.pem

# Ignore compressed files
*.zip
*.tar.gz
*.rar
*.7z

# WebGL-related binaries
*.obj
*.mtl
*.fbx
*.blend

# Image assets for game dev
*.psd
*.xcf
*.kra

# Ignore package-lock.json or yarn.lock if necessary
# Uncomment the following lines if you don't want to track lock files
# package-lock.json
# yarn.lock

temp
10 changes: 10 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"printWidth": 200,
"bracketSpacing": true,
"arrowParens": "always",
"endOfLine": "lf"
}
25 changes: 25 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// eslint.config.js
export default [
{
ignores: ['node_modules/**'],
files: ['**/*.js'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
env: {
browser: true, // Enable browser globals
},
plugins: {
prettier: {},
import: {}, // Add import plugin
},
rules: {
'no-unused-vars': 'warn',
'no-console': 'off',
semi: ['error', 'always'],
quotes: ['error', 'single'],
'no-undef': 'error',
},
},
];
Empty file added favicon.ico
Empty file.
16 changes: 16 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<html>
<head>
<style>
body {
margin: 0;
overflow: hidden;
}
canvas {
display: block;
}
</style>
</head>
<body>
<script type="module" src="./main.js"></script>
</body>
</html>
21 changes: 21 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import * as TR from './node_modules/three/build/three.module.js';
console.log('gl hf');

const MAP_SIZE = 48;
const g = {
MAP_W: MAP_SIZE,
MAP_H: MAP_SIZE,
};

const scene = new TR.Scene();
const renderer = new TR.WebGLRenderer({ antialias: false });
renderer.setPixelRatio(window.devicePixelRatio);
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);

const groundGeometry = new TR.PlaneGeometry(g.MAP_W, g.MAP_H);
const groundMesh = new TR.Mesh(groundGeometry);
scene.add(groundMesh);

const camera = new TR.PerspectiveCamera(60, window.innerWidth / window.innerHeight, 0.1, MAP_SIZE * 2);
camera.lookAt(new TR.Vector3(0, 0, 0));
Loading

0 comments on commit e2319f8

Please sign in to comment.