-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
180 additions
and
495 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,26 @@ | ||
import chroma from 'chroma-js'; | ||
import { Context } from 'hammerhead.gl/core'; | ||
import { Camera } from 'hammerhead.gl/scene'; | ||
import { Pane } from 'tweakpane'; | ||
import Inspector from '../../Inspector'; | ||
|
||
const canvas = document.getElementById('canvas') as HTMLCanvasElement; | ||
|
||
async function main() { | ||
const context = await Context.create(canvas); | ||
export function run(context: Context, pane: Inspector) { | ||
const renderer = context.renderer; | ||
|
||
const camera = new Camera('perspective'); | ||
function render() { | ||
renderer.render(null, camera); | ||
} | ||
|
||
setInterval(render, 500); | ||
|
||
context.on('resized', render); | ||
|
||
const PARAMS = { | ||
clearColor: {r: 255, g: 0, b: 55}, | ||
}; | ||
|
||
const pane = new Pane(); | ||
|
||
pane.addInput(PARAMS, 'clearColor').on('change', ev => { | ||
pane.exampleFolder.addInput(PARAMS, 'clearColor').on('change', ev => { | ||
const rgb = ev.value; | ||
const c = chroma(rgb.r, rgb.g, rgb.b); | ||
renderer.clearColor = c; | ||
render(); | ||
}) | ||
} | ||
|
||
main().catch(e => console.error(e)); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.