Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .vscode/.browse.VC.db
Binary file not shown.
Binary file added .vscode/.browse.VC.db-shm
Binary file not shown.
Binary file added .vscode/.browse.VC.db-wal
Binary file not shown.
48,884 changes: 48,884 additions & 0 deletions build/bundle.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions build/bundle.js.map

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions build/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<title>Project 6: Implicit Surfaces</title>
<style>
html, body {
margin: 0;
overflow: hidden;
}
canvas {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<script src="bundle.js"></script>
</body>
</html>
12 changes: 7 additions & 5 deletions src/inspect_point.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ export default class InspectPoint {
this.isovalue = isovalue;
this.label = null;

if (visualDebug) {
this.makeLabel();
}
// TODO
// Uncomment for debugging labels
// if (visualDebug) {
// this.makeLabel();
// }
};

// Create an HTML div for holding label
Expand All @@ -28,7 +30,7 @@ export default class InspectPoint {
this.label.style.cursor = 'default';
this.label.style.fontSize = '0.3em';
this.label.style.pointerEvents = 'none';
document.body.appendChild(this.label);
document.body.appendChild(this.label);
};

updateLabel(camera) {
Expand All @@ -40,7 +42,7 @@ export default class InspectPoint {
this.label.style.top = screenPos.y + 'px';
this.label.style.left = screenPos.x + 'px';
this.label.innerHTML = this.isovalue.toFixed(2);
this.label.style.opacity = this.isovalue - 0.5;
this.label.style.opacity = this.isovalue - 0.5;
}
};

Expand Down
18 changes: 9 additions & 9 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ import MarchingCubes from './marching_cubes.js'

const DEFAULT_VISUAL_DEBUG = true;
const DEFAULT_ISO_LEVEL = 1.0;
const DEFAULT_GRID_RES = 4;
const DEFAULT_GRID_RES = 30;
const DEFAULT_GRID_WIDTH = 10;
const DEFAULT_NUM_METABALLS = 10;
const DEFAULT_NUM_METABALLS = 3;
const DEFAULT_MIN_RADIUS = 0.5;
const DEFAULT_MAX_RADIUS = 1;
const DEFAULT_MAX_SPEED = 0.01;
const DEFAULT_MAX_SPEED = 0.1;

var App = {
//
//
marchingCubes: undefined,
config: {
// Global control of all visual debugging.
// This can be set to false to disallow any memory allocation of visual debugging components.
// Global control of all visual debugging.
// This can be set to false to disallow any memory allocation of visual debugging components.
// **Note**: If your application experiences performance drop, disable this flag.
visualDebug: DEFAULT_VISUAL_DEBUG,

Expand All @@ -38,7 +38,7 @@ var App = {
gridWidth: DEFAULT_GRID_WIDTH,

// Width of each voxel
// Ideally, we want the voxel to be small (higher resolution)
// Ideally, we want the voxel to be small (higher resolution)
gridCellWidth: DEFAULT_GRID_WIDTH / DEFAULT_GRID_RES,

// Number of metaballs
Expand Down Expand Up @@ -113,7 +113,7 @@ function setupScene(scene) {
function setupGUI(gui) {

// more information here: https://workshop.chromeexperiments.com/examples/gui/#1--Basic-Usage

// --- CONFIG ---
gui.add(App, 'isPaused').onChange(function(value) {
App.isPaused = value;
Expand Down Expand Up @@ -153,7 +153,7 @@ function setupGUI(gui) {
}
}
});
debugFolder.open();
debugFolder.open();
}

// when the scene is done initializing, it will call onLoad, then on frame updates, call onUpdate
Expand Down
Loading