n3d-threejs
This packages the Three.js library as a node.js module.
Note: This is only the minified core THREE
object packaged for easy deployment (e.g. it can be required and bundled using browserify on the server before being transmitted in a single http-response to the client) and does not include all of the additional utility files which come with a full Three.js installation (i.e. examples, post-processing/shaders, Controllers & other additional utilities) which in total amounts to around a 100Mb dependency. You can of course include any supplemental code by using <script src="">
tags in an index.html file as needed, although that would be sub-optimal because you are adding to the download overhead when initially loading the page with additional http requests.
Installation
npm install n3d-threejs
OR
cd <app-folder>/node_modulesgit clone git@github.com:joates/n3d-threejs.git
Example
var THREE = var width = windowinnerWidthvar height = windowinnerHeightvar scene camera renderer cube { scene = camera = 45 width/height 01 10000 renderer = renderer documentbody var geometry = 1 1 1 var material = color: 0x00ff00 cube = geometry material scene camerapositionz = 5} { } { cuberotationx += 01 cuberotationy += 01} { renderer}
License
The MIT License
Copyright © 2010-2015 three.js authors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.