three#Renderer TypeScript Examples
The following examples show how to use
three#Renderer.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Stage.ts From FairyGUI-threejs with MIT License | 5 votes |
public static init(renderer: Renderer, parameters?: StageInitParameters) {
init(renderer, parameters);
}
Example #2
Source File: Stage.ts From FairyGUI-threejs with MIT License | 5 votes |
function init(renderer: Renderer, parameters?: StageInitParameters) {
_renderer = renderer;
if (parameters) {
if (parameters.defaultLayer != null)
UILayer = parameters.defaultLayer;
if (parameters.screenMode)
_screenMode = parameters.screenMode;
}
_canvas = renderer.domElement;
_camera = new OrthographicCamera(-1, 1, 1, -1, 0, 1000);
_camera.layers.set(UILayer);
_touchscreen = is_touch_enabled();
if (renderer instanceof WebGLRenderer)
_devicePixelRatio = renderer.getPixelRatio();
_touches = [];
for (let i = 0; i < 5; i++)
_touches.push(new TouchInfo());
if (!_touchscreen)
_touches[0].touchId = 0;
_touchCount = 0;
_touchPos = new Vector2();
if (_touchscreen) {
document.addEventListener('touchstart', ev => handleTouch(ev, 0), { passive: false });
document.addEventListener('touchend', ev => handleTouch(ev, 1), { passive: false });
document.addEventListener('touchmove', ev => handleTouch(ev, 2), { passive: false });
document.addEventListener('touchcancel', ev => handleTouch(ev, 3), { passive: false });
}
else {
document.addEventListener('mousedown', ev => handleMouse(ev, 0), { passive: false });
document.addEventListener('mouseup', ev => handleMouse(ev, 1), { passive: false });
document.addEventListener('mousemove', ev => handleMouse(ev, 2), { passive: false });
}
document.addEventListener('wheel', ev => handleWheel(ev), { passive: false });
window.addEventListener('resize', onWindowResize, false);
onWindowResize();
}
Example #3
Source File: Stage.ts From FairyGUI-threejs with MIT License | 5 votes |
_renderer: Renderer