GithubHelp home page GithubHelp logo

dom2three's Introduction

DOM2three

Render web page element into three.js meshes for 3d radness!

Basic usage

1. Saving your HTML layout

  1. Create a HTML layout and include the dom2three.js onto the page with content you want to convert.

     <script src="dom2thee.js"></script>
    
  2. Tag any elements which you would like created into a three.js mesh with a data-mesh attribute.

     <div id="example" data-mesh> Example element </div>
    
  3. Run the gulp script on your project folder.

     gulp render yourproject/index.html
    
  4. The gulp script will place all the necessary data files into a dom2three sub-folder.

2. Adding DOM2three elements to your three.js scene.

  1. Include dom2three.js onto the page with your three.js scene. (step 1 above)

  2. Call load with the dom2three data folder (step 4 above)

     var d23 = DOM2three.load('dom2three_dir')
    

    Load returns a promise once we are ready to go.

  3. Retrieve a dom2three node and add the mesh to your three.js scene.

     d23.then( function() {
         var node = d23.getNodeById('example', true);
         scene.add( node.mesh );
     });
    

More usage notes

  • Create dynamic text areas from HTML layouts by specifying data-textarea attributes. You'll also need to include what mesh hosts this textarea by specifying data-hostmesh='mesh-name'.

Gotcha's!

  • Examples are not really real examples yet. It's what we need to for our project www.github.com/mozvr/HIRO. I will come up with basic examples that are more general purpose at a later date.

  • We are using JADE + SASS to make it quick for us to generate templates, but standard HTML/CSS pages will work too.

  • There's a few dependencies that need to be installed. We will need to create a isntall script to make this easier to work with.

dom2three's People

Contributors

caseyyee avatar

Stargazers

Shaw avatar VSWORK avatar  avatar Mike avatar Fabio Dias Rollo avatar  avatar James B. Pollack, MFA  avatar 曹文忠 avatar Mark avatar Michael Anthony avatar Marshall Bowers avatar  avatar William Attaway avatar Sean avatar Amber VR avatar CJ Yetman avatar Jeshua Maxey avatar Harrison Powers avatar Brian Peiris avatar Peter Ehrlich avatar JT5D avatar William Casarin avatar Ben Nolan avatar 牛さん avatar Rob Scanlon avatar Anastasis Germanidis avatar Jerad Bitner avatar Cecile Muller avatar Ben Sparks avatar

Watchers

Brian Peiris avatar Rob Scanlon avatar  avatar Michael Anthony avatar Jeshua Maxey avatar

Forkers

imclab

dom2three's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.