Skip to content

jeromeetienne/threex.windowresize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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()

Releases

No releases published

Packages

No packages published