mirror of
https://github.com/LucasDower/ObjToSchematic.git
synced 2024-12-21 03:09:14 +08:00
Cleanup
This commit is contained in:
parent
291ea43a6e
commit
cf1d164d2c
@ -18,16 +18,6 @@ function resizeCanvas() {
|
||||
}
|
||||
|
||||
resizeCanvas();
|
||||
|
||||
/*
|
||||
const suzanneLeft = new Mesh('./resources/suzanne_left.obj');
|
||||
voxelManager.voxeliseMesh(suzanneLeft);
|
||||
renderer.registerVoxels(voxelManager.voxels);
|
||||
|
||||
const suzanneRight = new Mesh('./resources/suzanne_right.obj');
|
||||
renderer.registerMesh(suzanneRight);
|
||||
*/
|
||||
|
||||
let loadedMesh = null;
|
||||
|
||||
document.querySelector("#objBtn").addEventListener('click', () => {
|
||||
@ -61,31 +51,15 @@ document.querySelector("#voxelBtn").addEventListener('click', () => {
|
||||
|
||||
renderer.clear();
|
||||
const mesh = voxelManager.buildMesh();
|
||||
|
||||
for (const box of mesh) {
|
||||
renderer.registerBox(box.centre, box.size, false);
|
||||
//renderer.registerBox(box.centre, box.size, true);
|
||||
}
|
||||
|
||||
//renderer.registerVoxels(voxelManager.voxels, false);
|
||||
|
||||
renderer.compileRegister();
|
||||
});
|
||||
|
||||
|
||||
|
||||
//voxelManager.addVoxel(new Vector3(0, 0, 0));
|
||||
//voxelManager.addVoxel(new Vector3(voxelSize, 0, 0));
|
||||
|
||||
loadedMesh = new Mesh("./resources/suzanne.obj");
|
||||
voxelManager.voxeliseMesh(loadedMesh);
|
||||
|
||||
const mesh = voxelManager.buildMesh();
|
||||
for (const box of mesh) {
|
||||
renderer.registerBox(box.centre, box.size, false);
|
||||
renderer.registerBox(box.centre, box.size, true);
|
||||
}
|
||||
renderer.compileRegister();
|
||||
|
||||
|
||||
function render(time) {
|
||||
resizeCanvas();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user