core_threejs
v1.0.1
Published
`core_threejs` is a JavaScript library that provides core functionalities built on top of Three.js, designed to simplify common 3D development tasks.
Readme
core_threejs
core_threejs is a JavaScript library that provides core functionalities built on top of Three.js, designed to simplify common 3D development tasks.
Installation
YouYou can install core_threejs via npm:
npm install core_threejsUsage
To use core_threejs in your project, you can import it as a module:
import AdvancedThreeJS from 'core_threejs';
// Initialize the AdvancedThreeJS class
const myThreeApp = new AdvancedThreeJS();
// You can now use the methods provided by the AdvancedThreeJS class
// For example, to initialize a basic scene:
myThreeApp.initScene();
myThreeApp.animate();Example
Here's a basic example of how to set up a scene with core_threejs:
import AdvancedThreeJS from 'core_threejs';
import * as THREE from 'three';
const container = document.getElementById('three-container');
const app = new AdvancedThreeJS(container);
app.initScene();
app.addCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
app.addRenderer();
const geometry = new THREE.BoxGeometry(1, 1, 1);
const material = new THREE.MeshBasicMaterial({ color: 0x00ff00 });
const cube = new THREE.Mesh(geometry, material);
app.addMesh(cube);
app.camera.position.z = 5;
app.animate();
window.addEventListener('resize', () => {
app.onWindowResize();
});Development
If you want to contribute or build the project from source:
- Clone the repository:
git clone https://github.com/your-repo/core_threejs.git cd core_threejs - Install dependencies:
npm install - Build the project:
This will generate the bundled files in thenpm run builddist/directory.
License
This project is licensed under the MIT License - see the LICENSE file for details.
