Coder Social home page Coder Social logo

sebastiannette / threex.windowresize Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jeromeetienne/threex.windowresize

0.0 2.0 1.0 231 KB

three.js extension to help you handle window resize

Home Page: http://jeromeetienne.github.io/threex.windowresize/examples/basic.html

License: MIT License

JavaScript 100.00%

threex.windowresize's Introduction

threex.windowresize

threex.windowresize is a three.js extension to help you handle window resize.

Here is a basic example and its source. Another example with devicePixelRatio and its source

How To Install It

You can install it manually. Just do

<script src='threex.windowresize.js'></script>

You can install with bower.

bower install threex.windowresize

then you add that in your html

<script src="bower_components/threex.windowresize/threex.windowresize.js"></script>

How To Use

You just have to instanciate the object. Then whenever you resize the window, it will resize the renderer canvas and adjust the camera accordingly.

var winResize	= new THREEx.WindowResize(renderer, camera)

If you need to destroy it at one point, just do winResize.destroy();. It fit well with devicePixelRatio, see an example below

renderer.devicePixelRatio	= 1/4
winResize.trigger()

threex.windowresize's People

Watchers

 avatar  avatar

Forkers

xuhaojun

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.