Giter Site home page Giter Site logo

threebox.js's Introduction

ThreeBox.js

ThreeBox.js

ThreeBox is a plug-in for tQuery/Three.js which provides an improved boilerplate set up.

It lets you easily embed Three.js scenes as elements in a web page, rather than just as a full-screen render. User-friendly mouse controls are also included.


Build:

  • ThreeBox.js: tQuery plug-in + dependencies
  • ThreeBox-core.js: tQuery plug-in only

Depends on: tQuery (Jerome Etienne et al.), Three.js (Ricardo Cabello et al.)

Usage

Create a tQuery world and call the threeBox method. You may use a shorthand syntax.

var options = { /* .. */ };     // Combined options object

// Fill the entire body.
var world = tQuery.createWorld(options).threeBox(options);

// or shorthand:
var world = threeBox(options);

// Fill a particular DOM element.
var world = tQuery.createWorld(options).threeBox(element, options);

// or shorthand:
var world = threeBox(element, options);

All arguments are optional. The following options are available for ThreeBox in addition to the normal tQuery world options:

  • cameraControls: true,
    Whether to allow mouse control of the camera.
  • controlClass: ThreeBox.OrbitControls,
    Override the class to use for mouse controls.
  • cursor: true,
    Whether to show the mouse cursor. When set to false, the cursor auto-hides after a short delay.
  • elementResize: true,
    Whether to track resizing of the containing element.
  • fullscreen: true,
    Enable fullscreen mode with 'f'
  • scale: 1,
    Render at scaled resolution, e.g. scale 2 is half the width/height. Fractional values allowed.
  • screenshot: true, Enable screenshot taking with 'p'
  • stats: true, Show FPS stats in the corner.

Steven Wittens - http://acko.net/

threebox.js's People

Contributors

unconed avatar

Watchers

James Cloos avatar  avatar

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.