diff --git a/images/result.png b/images/result.png index 63abc74..5f35b4a 100755 Binary files a/images/result.png and b/images/result.png differ diff --git a/index.html b/index.html index d2cf3de..ff0cb29 100755 --- a/index.html +++ b/index.html @@ -3,9 +3,23 @@ svg2cube + - +

svg2cube - demo

@@ -15,16 +29,22 @@

The buttons allow you to try different parameters.

- +

Input

+ +

Rendered output

+ -

Loading...

+

Real time output

+

Loading...

+
- - + + + @@ -47,7 +67,7 @@ "stroke": 'black', // stroke color for outline "stroke-width": 0, // outline width }, - size: 256, + size: 128, }); var gui = new dat.GUI(); diff --git a/readme.md b/readme.md index 0979bdb..43499a8 100755 --- a/readme.md +++ b/readme.md @@ -1,9 +1,15 @@ svg2cube -Generate isometric game sprites. Inputs an svg panel and it's folded into a cube and rendered from any angle. +Generate isometric game sprites. Inputs an svg panel and it's folded into a cube and rendered from any angle. [Example hosted here](https://wassname.github.io/svg2cube/). # Quickstart -TODO + +```bash +git clone git@github.com:wassname/svg2cube.git +cd svg2cube +npm i +node svg2cube-cli.js inputs/panels.svg +``` # Screenshots ## Input: @@ -22,7 +28,7 @@ TODO First try it using the supplied panel. From the command line: ```sh -npm svg2cube-cli.js inputs/panels.svg +node svg2cube-cli.js inputs/panels.svg ``` Or in node: diff --git a/svg2cube-frontend.js b/svg2cube-frontend.js index e0e48a6..9af5be6 100755 --- a/svg2cube-frontend.js +++ b/svg2cube-frontend.js @@ -156,7 +156,10 @@ ''); cube.append(imageBottom); - $('body').append(cube); + var target=$('#svg2cube'); + if (!target){target=$('body');} + + target.append(cube); } // Now we generate some css to put everything in good positions @@ -165,14 +168,14 @@ '