Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
harshcrop committed Dec 26, 2023
1 parent f444cc7 commit 9f50868
Show file tree
Hide file tree
Showing 8 changed files with 546 additions and 636 deletions.
Binary file added .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion libs/orbit-controls.js

Large diffs are not rendered by default.

1,109 changes: 509 additions & 600 deletions libs/trackball-controls.js

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ class App {

initCamera = () => {
this.ratio = window.innerWidth / window.innerHeight;
this.camera = new THREE.PerspectiveCamera(60, this.ratio, 0.1, 10000);
this.camera = new THREE.PerspectiveCamera(65, this.ratio, 0.1, 10000);
this.camera.lookAt(this.scene.position);
this.camera.position.set(0, 15, 30);
}

initControls = () => {

this.controls = new THREE.OrbitControls(this.camera, this.renderer.domElement);
}

Expand All @@ -51,6 +51,7 @@ class App {
this.stats.domElement.style.position = 'absolute';
this.stats.domElement.style.right = '10px';
this.stats.domElement.style.bottom = '10px';
this.stats.domElement.style.display = 'none';
document.body.appendChild( this.stats.domElement );
}

Expand All @@ -67,10 +68,10 @@ class App {
requestAnimationFrame(this.update);
}

addControlGui = callback => {
var gui = new dat.GUI();
callback(gui);
}
// addControlGui = callback => {
// var gui = new dat.GUI();
// callback(gui);
// }

handleResize = () => {
this.camera.aspect = window.innerWidth / window.innerHeight;
Expand Down
4 changes: 2 additions & 2 deletions scripts/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const config = {
globe: 0.001,
},
colors: {
globeDotColor: "rgb(203, 168, 0)",
globeMarkerColor: "rgb(143, 216, 216)",
globeDotColor: "rgb(255, 255, 255)",
globeMarkerColor: "rgb(255, 255, 255)",
globeMarkerGlow: "rgb(255, 255, 255)",
globeLines: "rgb(255, 255, 255)",
globeLinesDots: "rgb(255, 255, 255)",
Expand Down
2 changes: 1 addition & 1 deletion scripts/dots.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Dots {

class Dot {
constructor() {
this.radius = 2;
this.radius = 0.6;
this.segments = 32;
this.rings = 32;

Expand Down
50 changes: 25 additions & 25 deletions scripts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,38 +33,38 @@ async function preload() {
function setup(app) {
const controllers = [];

app.addControlGui((gui) => {
const colorFolder = gui.addFolder("Colors");
controllers.push(colorFolder.addColor(config.colors, "globeDotColor"));
controllers.push(colorFolder.addColor(config.colors, "globeMarkerColor"));
controllers.push(colorFolder.addColor(config.colors, "globeMarkerGlow"));
controllers.push(colorFolder.addColor(config.colors, "globeLines"));
controllers.push(colorFolder.addColor(config.colors, "globeLinesDots"));

const sizeFolder = gui.addFolder("Sizes");
controllers.push(sizeFolder.add(config.sizes, "globeDotSize", 1, 5));
controllers.push(sizeFolder.add(config.scale, "globeScale", 0.1, 1));

const displayFolder = gui.addFolder("Display");
controllers.push(displayFolder.add(config.display, "map"));
controllers.push(displayFolder.add(config.display, "points"));
controllers.push(displayFolder.add(config.display, "markers"));
controllers.push(displayFolder.add(config.display, "markerLabel"));
controllers.push(displayFolder.add(config.display, "markerPoint"));

const animationsFolder = gui.addFolder("Animations");
controllers.push(animationsFolder.add(animations, "rotateGlobe"));

sizeFolder.open();
});
// app.addControlGui((gui) => {
// const colorFolder = gui.addFolder("Colors");
// controllers.push(colorFolder.addColor(config.colors, "globeDotColor"));
// controllers.push(colorFolder.addColor(config.colors, "globeMarkerColor"));
// controllers.push(colorFolder.addColor(config.colors, "globeMarkerGlow"));
// controllers.push(colorFolder.addColor(config.colors, "globeLines"));
// controllers.push(colorFolder.addColor(config.colors, "globeLinesDots"));

// const sizeFolder = gui.addFolder("Sizes");
// controllers.push(sizeFolder.add(config.sizes, "globeDotSize", 1, 5));
// controllers.push(sizeFolder.add(config.scale, "globeScale", 0.1, 1));

// const displayFolder = gui.addFolder("Display");
// controllers.push(displayFolder.add(config.display, "map"));
// controllers.push(displayFolder.add(config.display, "points"));
// controllers.push(displayFolder.add(config.display, "markers"));
// controllers.push(displayFolder.add(config.display, "markerLabel"));
// controllers.push(displayFolder.add(config.display, "markerPoint"));

// const animationsFolder = gui.addFolder("Animations");
// controllers.push(animationsFolder.add(animations, "rotateGlobe"));

// sizeFolder.open();
// });

controllers.forEach((controller) => {
controller.onChange((event) => {
controls.changed = true;
});
});

app.camera.position.z = config.sizes.globe * 2.85;
app.camera.position.z = config.sizes.globe * 2;
app.camera.position.y = config.sizes.globe * 0;
app.controls.enableDamping = true;
app.controls.dampingFactor = 0.05;
Expand Down
2 changes: 1 addition & 1 deletion scripts/points.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class Points {

const circle = new fabric.Circle({
radius: radius / 2 - 2,
fill: 'blue',
fill: 'white',
left: 1,
top: 1
})
Expand Down

0 comments on commit 9f50868

Please sign in to comment.