Skip to content

Commit

Permalink
hoge
Browse files Browse the repository at this point in the history
  • Loading branch information
CaseyNelson314 committed Dec 26, 2023
1 parent 011ccc8 commit a4589fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/script/Field3D.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class ElectricFieldVectors3D extends THREE.Object3D {
this.add(cone);
}

const count = 5;
const count = 4;
for (let point_charge of this.point_charges) {
for (let x = -count; x <= count; x++) {
for (let y = -count; y <= count; y++) {
Expand Down
4 changes: 2 additions & 2 deletions app/script/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ const init = () => {
// 点電荷たち
const point_charges = [];

const n = 2;//Math.floor(Math.random() * 10) + 1;
const n = Math.floor(Math.random() * 10) + 1;
for (let i = 0; i < n; i++) {
const charge_sign = Math.random() > 0.5 ? 1 : -1;
point_charges.push(new PointCharge(1 * charge_sign, new THREE.Vector3().randomDirection().multiplyScalar(100)));
point_charges.push(new PointCharge(Math.random() * charge_sign, new THREE.Vector3().randomDirection().multiplyScalar(100)));
}

const field_3d = new Field3D(dom, camera, transControls, point_charges);
Expand Down

0 comments on commit a4589fd

Please sign in to comment.