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
48,937 changes: 48,937 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>
29 changes: 21 additions & 8 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import Framework from './framework'
import LUT from './marching_cube_LUT.js'
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_WIDTH = 10;
const DEFAULT_NUM_METABALLS = 10;
const DEFAULT_VISUAL_DEBUG = false;
const DEFAULT_ISO_LEVEL = 1.2;
const DEFAULT_GRID_RES = 15;
const DEFAULT_GRID_WIDTH = 20;
const DEFAULT_NUM_METABALLS = 5;
const DEFAULT_MIN_RADIUS = 0.5;
const DEFAULT_MAX_RADIUS = 1;
const DEFAULT_MAX_SPEED = 0.01;
const DEFAULT_MAX_RADIUS = 1.0;
const DEFAULT_MAX_SPEED = 0.5;

var App = {
//
Expand Down Expand Up @@ -51,7 +51,13 @@ var App = {
maxRadius: DEFAULT_MAX_RADIUS,

// Maximum speed of a metaball
maxSpeed: DEFAULT_MAX_SPEED
maxSpeed: DEFAULT_MAX_SPEED,

// Color of material
color: "#ffffff",

// Color of ambient light
ambient: "#ffffff"
},

// Scene's framework objects
Expand Down Expand Up @@ -129,6 +135,13 @@ function setupGUI(gui) {
App.marchingCubes.init(App);
});

gui.addColor(App.config, 'color').onChange(function(value){
App.marchingCubes.updateColor(value);
});

gui.addColor(App.config, 'ambient').onChange(function(value){
App.marchingCubes.updateAmbient(value);
});
// --- DEBUG ---

var debugFolder = gui.addFolder('Debug');
Expand Down
Loading