diff --git a/.gitignore b/.gitignore index dc99ae877bb12722f60c567114629f5e6775dff8..e1777316cc8a34b6c53f0ae12504b6c66fbdb272 100644 --- a/.gitignore +++ b/.gitignore @@ -1,25 +1,10 @@ -.DS_Store -node_modules -/dist +run = "npm i && npm run dev" +language = "node" +[env] +PATH = "/root/${PROJECT_DIR}/.config/npm/node_global/bin:/root/${PROJECT_DIR}/node_modules/.bin:${PATH}" +XDG_CONFIG_HOME = "/root/.config" +npm_config_prefix = "/root/${PROJECT_DIR}/.config/npm/node_global" -# local env files -.env.local -.env.*.local - -# Log files -npm-debug.log* -yarn-debug.log* -yarn-error.log* -pnpm-debug.log* -package-lock.json - -# Editor directories and files -.idea -.vscode/* -!.vscode/preview.yml -*.suo -*.ntvs* -*.njsproj -*.sln -*.sw? +[debugger] +program = "main.js" diff --git a/.inscode b/.inscode index ecc8bdde946f464a2c4d431d8f8196413737d922..e1777316cc8a34b6c53f0ae12504b6c66fbdb272 100644 --- a/.inscode +++ b/.inscode @@ -1,6 +1,10 @@ run = "npm i && npm run dev" +language = "node" [env] PATH = "/root/${PROJECT_DIR}/.config/npm/node_global/bin:/root/${PROJECT_DIR}/node_modules/.bin:${PATH}" XDG_CONFIG_HOME = "/root/.config" -npm_config_prefix = "/root/${PROJECT_DIR}/.config/npm/node_global" \ No newline at end of file +npm_config_prefix = "/root/${PROJECT_DIR}/.config/npm/node_global" + +[debugger] +program = "main.js" diff --git a/index.js b/index.js index 2d7e6834fb6366b3120c7a37cc5f637bc4a33928..82515062eff1597a1daa853aeca4f516de6f6106 100644 --- a/index.js +++ b/index.js @@ -1 +1,28 @@ -console.log("欢迎来到 InsCode"); \ No newline at end of file +const THREE = require('three'); + +// 创建场景 +const scene = new THREE.Scene(); + +// 创建相机 +const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000); +camera.position.z = 5; + +// 创建渲染器 +const renderer = new THREE.WebGLRenderer(); +renderer.setSize(window.innerWidth, window.innerHeight); +document.body.appendChild(renderer.domElement); + +// 创建一个立方体 +const geometry = new THREE.BoxGeometry(); +const material = new THREE.MeshBasicMaterial({ color: 0x00ff00 }); +const cube = new THREE.Mesh(geometry, material); +scene.add(cube); + +// 渲染循环 +function animate() { + requestAnimationFrame(animate); + cube.rotation.x += 0.01; + cube.rotation.y += 0.01; + renderer.render(scene, camera); +} +animate(); \ No newline at end of file