From 9786b10f169516a978f6010e8a7a00e40ba0ccb7 Mon Sep 17 00:00:00 2001 From: moqn Date: Sun, 6 Oct 2024 23:01:25 +0800 Subject: [PATCH] update the example code --- .../01_object_organization}/css/style.css | 0 .../01_object_organization}/index.html | 0 .../01_object_organization/js/main.js | 0 .../01_object_organization}/js/script-p5.js | 0 .../01_object_organization}/js/script-three.js | 0 .../02_dynamicArrays_prep}/css/style.css | 0 .../02_dynamicArrays_prep}/index.html | 0 .../02_dynamicArrays_prep/js/main.js | 0 .../02_dynamicArrays_prep}/js/script-p5.js | 0 .../02_dynamicArrays_prep}/js/script-three.js | 0 .../03_dynamicArrays_remove}/css/style.css | 0 .../03_dynamicArrays_remove}/index.html | 0 .../03_dynamicArrays_remove/js/main.js | 0 .../03_dynamicArrays_remove}/js/script-p5.js | 0 .../03_dynamicArrays_remove}/js/script-three.js | 0 .../04_dynamicArrays_lifespan}/css/style.css | 0 .../04_dynamicArrays_lifespan}/index.html | 0 .../04_dynamicArrays_lifespan/js/main.js | 0 .../04_dynamicArrays_lifespan}/js/script-p5.js | 0 .../04_dynamicArrays_lifespan}/js/script-three.js | 0 .../01_gui_updating_values_manually}/css/style.css | 0 .../01_gui_updating_values_manually}/index.html | 0 .../01_gui_updating_values_manually/js/main.js | 3 +-- .../01_gui_updating_values_manually}/js/script-p5.js | 0 .../01_gui_updating_values_manually}/js/script-three.js | 0 .../02_gui_using_JSObjects_and_folders}/css/style.css | 0 .../02_gui_using_JSObjects_and_folders}/index.html | 0 .../02_gui_using_JSObjects_and_folders/js/main.js | 3 +-- .../02_gui_using_JSObjects_and_folders}/js/script-p5.js | 0 .../02_gui_using_JSObjects_and_folders}/js/script-three.js | 0 .../03_gui_manipulating_objects}/css/style.css | 0 .../03_gui_manipulating_objects}/index.html | 0 .../03_gui_manipulating_objects/js/main.js | 2 +- .../03_gui_manipulating_objects}/js/script-p5.js | 0 .../03_gui_manipulating_objects}/js/script-three.js | 0 35 files changed, 3 insertions(+), 5 deletions(-) rename {04a_gui/01_gui_updating_values_manually => 04a_objects_dynamicArrays/01_object_organization}/css/style.css (100%) rename {04a_gui/01_gui_updating_values_manually => 04a_objects_dynamicArrays/01_object_organization}/index.html (100%) rename {04b_objects_dynamicArrays => 04a_objects_dynamicArrays}/01_object_organization/js/main.js (100%) rename {04a_gui/01_gui_updating_values_manually => 04a_objects_dynamicArrays/01_object_organization}/js/script-p5.js (100%) rename {04a_gui/01_gui_updating_values_manually => 04a_objects_dynamicArrays/01_object_organization}/js/script-three.js (100%) rename {04a_gui/02_gui_using_JSObjects_and_folders => 04a_objects_dynamicArrays/02_dynamicArrays_prep}/css/style.css (100%) rename {04a_gui/02_gui_using_JSObjects_and_folders => 04a_objects_dynamicArrays/02_dynamicArrays_prep}/index.html (100%) rename {04b_objects_dynamicArrays => 04a_objects_dynamicArrays}/02_dynamicArrays_prep/js/main.js (100%) rename {04a_gui/02_gui_using_JSObjects_and_folders => 04a_objects_dynamicArrays/02_dynamicArrays_prep}/js/script-p5.js (100%) rename {04a_gui/02_gui_using_JSObjects_and_folders => 04a_objects_dynamicArrays/02_dynamicArrays_prep}/js/script-three.js (100%) rename {04a_gui/03_gui_manipulating_objects => 04a_objects_dynamicArrays/03_dynamicArrays_remove}/css/style.css (100%) rename {04a_gui/03_gui_manipulating_objects => 04a_objects_dynamicArrays/03_dynamicArrays_remove}/index.html (100%) rename {04b_objects_dynamicArrays => 04a_objects_dynamicArrays}/03_dynamicArrays_remove/js/main.js (100%) rename {04a_gui/03_gui_manipulating_objects => 04a_objects_dynamicArrays/03_dynamicArrays_remove}/js/script-p5.js (100%) rename {04a_gui/03_gui_manipulating_objects => 04a_objects_dynamicArrays/03_dynamicArrays_remove}/js/script-three.js (100%) rename {04b_objects_dynamicArrays/01_object_organization => 04a_objects_dynamicArrays/04_dynamicArrays_lifespan}/css/style.css (100%) rename {04b_objects_dynamicArrays/01_object_organization => 04a_objects_dynamicArrays/04_dynamicArrays_lifespan}/index.html (100%) rename {04b_objects_dynamicArrays => 04a_objects_dynamicArrays}/04_dynamicArrays_lifespan/js/main.js (100%) rename {04b_objects_dynamicArrays/01_object_organization => 04a_objects_dynamicArrays/04_dynamicArrays_lifespan}/js/script-p5.js (100%) rename {04b_objects_dynamicArrays/01_object_organization => 04a_objects_dynamicArrays/04_dynamicArrays_lifespan}/js/script-three.js (100%) rename {04b_objects_dynamicArrays/02_dynamicArrays_prep => 04b_adding_gui/01_gui_updating_values_manually}/css/style.css (100%) rename {04b_objects_dynamicArrays/02_dynamicArrays_prep => 04b_adding_gui/01_gui_updating_values_manually}/index.html (100%) rename {04a_gui => 04b_adding_gui}/01_gui_updating_values_manually/js/main.js (96%) rename {04b_objects_dynamicArrays/02_dynamicArrays_prep => 04b_adding_gui/01_gui_updating_values_manually}/js/script-p5.js (100%) rename {04b_objects_dynamicArrays/02_dynamicArrays_prep => 04b_adding_gui/01_gui_updating_values_manually}/js/script-three.js (100%) rename {04b_objects_dynamicArrays/03_dynamicArrays_remove => 04b_adding_gui/02_gui_using_JSObjects_and_folders}/css/style.css (100%) rename {04b_objects_dynamicArrays/03_dynamicArrays_remove => 04b_adding_gui/02_gui_using_JSObjects_and_folders}/index.html (100%) rename {04a_gui => 04b_adding_gui}/02_gui_using_JSObjects_and_folders/js/main.js (97%) rename {04b_objects_dynamicArrays/03_dynamicArrays_remove => 04b_adding_gui/02_gui_using_JSObjects_and_folders}/js/script-p5.js (100%) rename {04b_objects_dynamicArrays/03_dynamicArrays_remove => 04b_adding_gui/02_gui_using_JSObjects_and_folders}/js/script-three.js (100%) rename {04b_objects_dynamicArrays/04_dynamicArrays_lifespan => 04b_adding_gui/03_gui_manipulating_objects}/css/style.css (100%) rename {04b_objects_dynamicArrays/04_dynamicArrays_lifespan => 04b_adding_gui/03_gui_manipulating_objects}/index.html (100%) rename {04a_gui => 04b_adding_gui}/03_gui_manipulating_objects/js/main.js (98%) rename {04b_objects_dynamicArrays/04_dynamicArrays_lifespan => 04b_adding_gui/03_gui_manipulating_objects}/js/script-p5.js (100%) rename {04b_objects_dynamicArrays/04_dynamicArrays_lifespan => 04b_adding_gui/03_gui_manipulating_objects}/js/script-three.js (100%) diff --git a/04a_gui/01_gui_updating_values_manually/css/style.css b/04a_objects_dynamicArrays/01_object_organization/css/style.css similarity index 100% rename from 04a_gui/01_gui_updating_values_manually/css/style.css rename to 04a_objects_dynamicArrays/01_object_organization/css/style.css diff --git a/04a_gui/01_gui_updating_values_manually/index.html b/04a_objects_dynamicArrays/01_object_organization/index.html similarity index 100% rename from 04a_gui/01_gui_updating_values_manually/index.html rename to 04a_objects_dynamicArrays/01_object_organization/index.html diff --git a/04b_objects_dynamicArrays/01_object_organization/js/main.js b/04a_objects_dynamicArrays/01_object_organization/js/main.js similarity index 100% rename from 04b_objects_dynamicArrays/01_object_organization/js/main.js rename to 04a_objects_dynamicArrays/01_object_organization/js/main.js diff --git a/04a_gui/01_gui_updating_values_manually/js/script-p5.js b/04a_objects_dynamicArrays/01_object_organization/js/script-p5.js similarity index 100% rename from 04a_gui/01_gui_updating_values_manually/js/script-p5.js rename to 04a_objects_dynamicArrays/01_object_organization/js/script-p5.js diff --git a/04a_gui/01_gui_updating_values_manually/js/script-three.js b/04a_objects_dynamicArrays/01_object_organization/js/script-three.js similarity index 100% rename from 04a_gui/01_gui_updating_values_manually/js/script-three.js rename to 04a_objects_dynamicArrays/01_object_organization/js/script-three.js diff --git a/04a_gui/02_gui_using_JSObjects_and_folders/css/style.css b/04a_objects_dynamicArrays/02_dynamicArrays_prep/css/style.css similarity index 100% rename from 04a_gui/02_gui_using_JSObjects_and_folders/css/style.css rename to 04a_objects_dynamicArrays/02_dynamicArrays_prep/css/style.css diff --git a/04a_gui/02_gui_using_JSObjects_and_folders/index.html b/04a_objects_dynamicArrays/02_dynamicArrays_prep/index.html similarity index 100% rename from 04a_gui/02_gui_using_JSObjects_and_folders/index.html rename to 04a_objects_dynamicArrays/02_dynamicArrays_prep/index.html diff --git a/04b_objects_dynamicArrays/02_dynamicArrays_prep/js/main.js b/04a_objects_dynamicArrays/02_dynamicArrays_prep/js/main.js similarity index 100% rename from 04b_objects_dynamicArrays/02_dynamicArrays_prep/js/main.js rename to 04a_objects_dynamicArrays/02_dynamicArrays_prep/js/main.js diff --git a/04a_gui/02_gui_using_JSObjects_and_folders/js/script-p5.js b/04a_objects_dynamicArrays/02_dynamicArrays_prep/js/script-p5.js similarity index 100% rename from 04a_gui/02_gui_using_JSObjects_and_folders/js/script-p5.js rename to 04a_objects_dynamicArrays/02_dynamicArrays_prep/js/script-p5.js diff --git a/04a_gui/02_gui_using_JSObjects_and_folders/js/script-three.js b/04a_objects_dynamicArrays/02_dynamicArrays_prep/js/script-three.js similarity index 100% rename from 04a_gui/02_gui_using_JSObjects_and_folders/js/script-three.js rename to 04a_objects_dynamicArrays/02_dynamicArrays_prep/js/script-three.js diff --git a/04a_gui/03_gui_manipulating_objects/css/style.css b/04a_objects_dynamicArrays/03_dynamicArrays_remove/css/style.css similarity index 100% rename from 04a_gui/03_gui_manipulating_objects/css/style.css rename to 04a_objects_dynamicArrays/03_dynamicArrays_remove/css/style.css diff --git a/04a_gui/03_gui_manipulating_objects/index.html b/04a_objects_dynamicArrays/03_dynamicArrays_remove/index.html similarity index 100% rename from 04a_gui/03_gui_manipulating_objects/index.html rename to 04a_objects_dynamicArrays/03_dynamicArrays_remove/index.html diff --git a/04b_objects_dynamicArrays/03_dynamicArrays_remove/js/main.js b/04a_objects_dynamicArrays/03_dynamicArrays_remove/js/main.js similarity index 100% rename from 04b_objects_dynamicArrays/03_dynamicArrays_remove/js/main.js rename to 04a_objects_dynamicArrays/03_dynamicArrays_remove/js/main.js diff --git a/04a_gui/03_gui_manipulating_objects/js/script-p5.js b/04a_objects_dynamicArrays/03_dynamicArrays_remove/js/script-p5.js similarity index 100% rename from 04a_gui/03_gui_manipulating_objects/js/script-p5.js rename to 04a_objects_dynamicArrays/03_dynamicArrays_remove/js/script-p5.js diff --git a/04a_gui/03_gui_manipulating_objects/js/script-three.js b/04a_objects_dynamicArrays/03_dynamicArrays_remove/js/script-three.js similarity index 100% rename from 04a_gui/03_gui_manipulating_objects/js/script-three.js rename to 04a_objects_dynamicArrays/03_dynamicArrays_remove/js/script-three.js diff --git a/04b_objects_dynamicArrays/01_object_organization/css/style.css b/04a_objects_dynamicArrays/04_dynamicArrays_lifespan/css/style.css similarity index 100% rename from 04b_objects_dynamicArrays/01_object_organization/css/style.css rename to 04a_objects_dynamicArrays/04_dynamicArrays_lifespan/css/style.css diff --git a/04b_objects_dynamicArrays/01_object_organization/index.html b/04a_objects_dynamicArrays/04_dynamicArrays_lifespan/index.html similarity index 100% rename from 04b_objects_dynamicArrays/01_object_organization/index.html rename to 04a_objects_dynamicArrays/04_dynamicArrays_lifespan/index.html diff --git a/04b_objects_dynamicArrays/04_dynamicArrays_lifespan/js/main.js b/04a_objects_dynamicArrays/04_dynamicArrays_lifespan/js/main.js similarity index 100% rename from 04b_objects_dynamicArrays/04_dynamicArrays_lifespan/js/main.js rename to 04a_objects_dynamicArrays/04_dynamicArrays_lifespan/js/main.js diff --git a/04b_objects_dynamicArrays/01_object_organization/js/script-p5.js b/04a_objects_dynamicArrays/04_dynamicArrays_lifespan/js/script-p5.js similarity index 100% rename from 04b_objects_dynamicArrays/01_object_organization/js/script-p5.js rename to 04a_objects_dynamicArrays/04_dynamicArrays_lifespan/js/script-p5.js diff --git a/04b_objects_dynamicArrays/01_object_organization/js/script-three.js b/04a_objects_dynamicArrays/04_dynamicArrays_lifespan/js/script-three.js similarity index 100% rename from 04b_objects_dynamicArrays/01_object_organization/js/script-three.js rename to 04a_objects_dynamicArrays/04_dynamicArrays_lifespan/js/script-three.js diff --git a/04b_objects_dynamicArrays/02_dynamicArrays_prep/css/style.css b/04b_adding_gui/01_gui_updating_values_manually/css/style.css similarity index 100% rename from 04b_objects_dynamicArrays/02_dynamicArrays_prep/css/style.css rename to 04b_adding_gui/01_gui_updating_values_manually/css/style.css diff --git a/04b_objects_dynamicArrays/02_dynamicArrays_prep/index.html b/04b_adding_gui/01_gui_updating_values_manually/index.html similarity index 100% rename from 04b_objects_dynamicArrays/02_dynamicArrays_prep/index.html rename to 04b_adding_gui/01_gui_updating_values_manually/index.html diff --git a/04a_gui/01_gui_updating_values_manually/js/main.js b/04b_adding_gui/01_gui_updating_values_manually/js/main.js similarity index 96% rename from 04a_gui/01_gui_updating_values_manually/js/main.js rename to 04b_adding_gui/01_gui_updating_values_manually/js/main.js index e59654c4..eb8be3b4 100644 --- a/04a_gui/01_gui_updating_values_manually/js/main.js +++ b/04b_adding_gui/01_gui_updating_values_manually/js/main.js @@ -13,6 +13,7 @@ let cube; function setupThree() { cube = getBox(); + scene.add(cube); // don't forget to add to scene cube.position.set(1, 0, 0); //(x, y, z); cube.scale.x = 100; cube.scale.y = 100; @@ -54,7 +55,5 @@ function getBox() { color: 0xffffff, }); mesh = new THREE.Mesh(geometry, material); - scene.add(mesh); // *** reorganize *** - return mesh; } \ No newline at end of file diff --git a/04b_objects_dynamicArrays/02_dynamicArrays_prep/js/script-p5.js b/04b_adding_gui/01_gui_updating_values_manually/js/script-p5.js similarity index 100% rename from 04b_objects_dynamicArrays/02_dynamicArrays_prep/js/script-p5.js rename to 04b_adding_gui/01_gui_updating_values_manually/js/script-p5.js diff --git a/04b_objects_dynamicArrays/02_dynamicArrays_prep/js/script-three.js b/04b_adding_gui/01_gui_updating_values_manually/js/script-three.js similarity index 100% rename from 04b_objects_dynamicArrays/02_dynamicArrays_prep/js/script-three.js rename to 04b_adding_gui/01_gui_updating_values_manually/js/script-three.js diff --git a/04b_objects_dynamicArrays/03_dynamicArrays_remove/css/style.css b/04b_adding_gui/02_gui_using_JSObjects_and_folders/css/style.css similarity index 100% rename from 04b_objects_dynamicArrays/03_dynamicArrays_remove/css/style.css rename to 04b_adding_gui/02_gui_using_JSObjects_and_folders/css/style.css diff --git a/04b_objects_dynamicArrays/03_dynamicArrays_remove/index.html b/04b_adding_gui/02_gui_using_JSObjects_and_folders/index.html similarity index 100% rename from 04b_objects_dynamicArrays/03_dynamicArrays_remove/index.html rename to 04b_adding_gui/02_gui_using_JSObjects_and_folders/index.html diff --git a/04a_gui/02_gui_using_JSObjects_and_folders/js/main.js b/04b_adding_gui/02_gui_using_JSObjects_and_folders/js/main.js similarity index 97% rename from 04a_gui/02_gui_using_JSObjects_and_folders/js/main.js rename to 04b_adding_gui/02_gui_using_JSObjects_and_folders/js/main.js index b4f4110f..daba269d 100644 --- a/04a_gui/02_gui_using_JSObjects_and_folders/js/main.js +++ b/04b_adding_gui/02_gui_using_JSObjects_and_folders/js/main.js @@ -8,6 +8,7 @@ let cube; function setupThree() { cube = getBox(); + scene.add(cube); // don't forget to add to scene cube.position.set(1, 0, 0); //(x, y, z); cube.scale.x = 100; cube.scale.y = 100; @@ -58,7 +59,5 @@ function getBox() { color: 0xffffff, }); mesh = new THREE.Mesh(geometry, material); - scene.add(mesh); // *** reorganize *** - return mesh; } \ No newline at end of file diff --git a/04b_objects_dynamicArrays/03_dynamicArrays_remove/js/script-p5.js b/04b_adding_gui/02_gui_using_JSObjects_and_folders/js/script-p5.js similarity index 100% rename from 04b_objects_dynamicArrays/03_dynamicArrays_remove/js/script-p5.js rename to 04b_adding_gui/02_gui_using_JSObjects_and_folders/js/script-p5.js diff --git a/04b_objects_dynamicArrays/03_dynamicArrays_remove/js/script-three.js b/04b_adding_gui/02_gui_using_JSObjects_and_folders/js/script-three.js similarity index 100% rename from 04b_objects_dynamicArrays/03_dynamicArrays_remove/js/script-three.js rename to 04b_adding_gui/02_gui_using_JSObjects_and_folders/js/script-three.js diff --git a/04b_objects_dynamicArrays/04_dynamicArrays_lifespan/css/style.css b/04b_adding_gui/03_gui_manipulating_objects/css/style.css similarity index 100% rename from 04b_objects_dynamicArrays/04_dynamicArrays_lifespan/css/style.css rename to 04b_adding_gui/03_gui_manipulating_objects/css/style.css diff --git a/04b_objects_dynamicArrays/04_dynamicArrays_lifespan/index.html b/04b_adding_gui/03_gui_manipulating_objects/index.html similarity index 100% rename from 04b_objects_dynamicArrays/04_dynamicArrays_lifespan/index.html rename to 04b_adding_gui/03_gui_manipulating_objects/index.html diff --git a/04a_gui/03_gui_manipulating_objects/js/main.js b/04b_adding_gui/03_gui_manipulating_objects/js/main.js similarity index 98% rename from 04a_gui/03_gui_manipulating_objects/js/main.js rename to 04b_adding_gui/03_gui_manipulating_objects/js/main.js index 63fd8b85..4d565669 100644 --- a/04a_gui/03_gui_manipulating_objects/js/main.js +++ b/04b_adding_gui/03_gui_manipulating_objects/js/main.js @@ -102,7 +102,6 @@ function getBox() { //wireframe: true }); let mesh = new THREE.Mesh(geometry, material); - scene.add(mesh); // *** reorganize *** return mesh; } @@ -124,6 +123,7 @@ class Cube { this.isDone = false; // this.mesh = getBox(); + scene.add(this.mesh); // don't forget to add to scene } setPosition(x, y, z) { this.pos = createVector(x, y, z); diff --git a/04b_objects_dynamicArrays/04_dynamicArrays_lifespan/js/script-p5.js b/04b_adding_gui/03_gui_manipulating_objects/js/script-p5.js similarity index 100% rename from 04b_objects_dynamicArrays/04_dynamicArrays_lifespan/js/script-p5.js rename to 04b_adding_gui/03_gui_manipulating_objects/js/script-p5.js diff --git a/04b_objects_dynamicArrays/04_dynamicArrays_lifespan/js/script-three.js b/04b_adding_gui/03_gui_manipulating_objects/js/script-three.js similarity index 100% rename from 04b_objects_dynamicArrays/04_dynamicArrays_lifespan/js/script-three.js rename to 04b_adding_gui/03_gui_manipulating_objects/js/script-three.js