[ Launch: basic FSS canvas ] 5250708 by enjalot
-
-
Save enjalot/5250708 to your computer and use it in GitHub Desktop.
basic FSS canvas
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
{"description":"basic FSS canvas","endpoint":"","display":"div","public":true,"require":[{"name":"fss","url":"https://raw.github.com/wagerfield/flat-surface-shader/master/deploy/fss.min.js"}],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"thumbnail":"http://i.imgur.com/yuKrWnb.png"} |
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
//http://wagerfield.github.com/flat-surface-shader/ | |
//https://github.com/wagerfield/flat-surface-shader | |
var container = d3.select("#display").node(); | |
var renderer = new FSS.CanvasRenderer(); | |
container.appendChild(renderer.element); | |
// 3) Create a Scene: | |
var scene = new FSS.Scene(); | |
// 4) Create some Geometry & a Material, pass them to a Mesh constructor, and add the Mesh to the Scene: | |
var geometry = new FSS.Plane(200, 100, 4, 2); | |
var material = new FSS.Material('#444444', '#FFFFFF'); | |
var mesh = new FSS.Mesh(geometry, material); | |
scene.add(mesh); | |
// 5) Create and add a Light to the Scene: | |
var light = new FSS.Light('#FF0000', '#0000FF'); | |
scene.add(light); | |
// 6) Finally, render the Scene: | |
renderer.render(scene); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment