Skip to content

sarurururu/polyuworld-addon-chemistry-lab

Repository files navigation

polyuworld-addon-chemistry-lab

three.js examples

Terrain

    // Ground

				const plane = new THREE.Mesh(
					new THREE.PlaneGeometry( 40, 40 ),
					new THREE.MeshPhongMaterial( { color: 0xcbcbcb, specular: 0x474747 } )
				);
				plane.rotation.x = - Math.PI / 2;
				plane.position.y = - 0.5;
				scene.add( plane );

				plane.receiveShadow = true;
scene.add( new THREE.HemisphereLight( 0x8d7c7c, 0x494966, 3 ) );

Generate Ground

const gridSize = 10; // Number of planes in each direction
const planeSize = 1; // Size of each plane

// Create a material for the planes
const material = new THREE.MeshBasicMaterial({ color: 0x00ff00, side: THREE.DoubleSide });

// Create the grid using multiple planes
for (let i = -gridSize; i <= gridSize; i++) {
    for (let j = -gridSize; j <= gridSize; j++) {
        const geometry = new THREE.PlaneGeometry(planeSize, planeSize);
        const plane = new THREE.Mesh(geometry, material);
        plane.position.set(i * planeSize, 1, j * planeSize);
        plane.rotation.x = -Math.PI / 2; // Rotate to make it horizontal
        APP.scene.sceneEl.object3D.add(plane);
    }
}

Debug

const geometry = new THREE.BoxGeometry( 1, 1, 1 ); 
const material = new THREE.MeshBasicMaterial( {color: 0x00ff00} ); 
const cube = new THREE.Mesh( geometry, material ); 
cube.position.set(0, 1.8, 0);
APP.scene.sceneEl.object3D.add(cube); // scene.add in aframe

TODOs

const Builder = require("three-pathfinding/src/Builder");
  const geometry = new THREE.Geometry().fromBufferGeometry(navMeshObj.geometry);

  const navMeshData = Builder.buildZone(geometry);

sceneEl.systems.nav.loadMesh

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published