File tree Expand file tree Collapse file tree 3 files changed +25
-6
lines changed
Expand file tree Collapse file tree 3 files changed +25
-6
lines changed Original file line number Diff line number Diff line change 33This is an example of how you can run three.js in your terminal.
44Sysadmins can now run three.js in remote ssh sessions!
55
6+ ### Install and Running
7+
8+ ```
9+ npm i -g threejs-term
10+ threejs-term
11+ ```
12+
613### Features
714- Shows off using three.js in node based environments.
815- Terminal / ASCII based rendering
@@ -13,11 +20,13 @@ Sysadmins can now run three.js in remote ssh sessions!
1320### Internals
1421This is built with some awesome libraries.
1522- [ three.js] ( https://github.com/mrdoob/three.js/ ) - Duh!
16- - [ blessed] ( https://github.com/chjj/blessed ) - Loads of terminal goodies!
17- - [ node-canvas] ( https://github.com/Automattic/node-canvas ) - Canvas emulation on node.js
23+ - [ blessed] ( https://github.com/chjj/blessed ) - Loads of terminal goodness!
24+ - [ node-canvas] ( https://github.com/Automattic/node-canvas ) - Canvas emulation on node.js
1825
1926### Development
2027
28+ Play with the [ source] ( https://github.com/zz85/threejs-term/blob/master/play.js )
29+
2130Install dependencies
2231```
2332yarn install # or npm install
@@ -30,6 +39,7 @@ node play.js
3039
3140It's tricky to debug blessed apps (since console.log's gonna messup the terminal),
3241so I'll pipe console.error messages to a log file and tail it elsewhere.
42+ log() helper function can also be used.
3343
3444```
3545node play.js 2>> logs.txt
Original file line number Diff line number Diff line change 11{
2- "name" : " three-blessed " ,
2+ "name" : " threejs-term " ,
33 "version" : " 1.0.0" ,
4- "main" : " index .js" ,
4+ "main" : " play .js" ,
55 "license" : " MIT" ,
6+ "bin" : {
7+ "threejs-term" : " play.js"
8+ },
9+ "scripts" : {
10+ "start" : " node play.js"
11+ },
612 "dependencies" : {
713 "blessed" : " ^0.1.81" ,
14+ "blessed-contrib" : " ^4.5.5" ,
815 "canvas" : " ^1.6.1" ,
916 "three" : " ^0.82.1"
10- }
17+ },
18+ "url" : " https://github.com/zz85/threejs-term"
1119}
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env node
2+
13THREE = require ( 'three' ) ;
24Canvas = require ( 'canvas' ) ;
35
@@ -6,7 +8,6 @@ require('three/examples/js/renderers/SoftwareRenderer');
68require ( 'three/examples/js/renderers/CanvasRenderer' ) ;
79
810require ( 'three/examples/js/controls/TrackballControls' ) ;
9- // require('./track');
1011
1112const fs = require ( 'fs' ) ;
1213
You can’t perform that action at this time.
0 commit comments