mirror of
https://github.com/Doodle3D/Doodle3D-Core.git
synced 2024-12-22 11:03:48 +01:00
add render chain
This commit is contained in:
parent
c0dde779e1
commit
5080402c85
19
src/d3/RenderChain.js
vendored
Normal file
19
src/d3/RenderChain.js
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
export default class RenderChain {
|
||||
constructor(renderer, scene, camera) {
|
||||
this._renderer = renderer;
|
||||
this._scene = scene;
|
||||
this._camera = camera;
|
||||
}
|
||||
|
||||
setSize(width, height) {
|
||||
this._renderer.setSize(width, height);
|
||||
|
||||
// adjust aspect ratio of camera
|
||||
this._camera.aspect = width / height;
|
||||
this._camera.updateProjectionMatrix();
|
||||
}
|
||||
|
||||
render() {
|
||||
this._renderer.render(this._scene, this._camera);
|
||||
}
|
||||
}
|
3
src/d3/index.js
vendored
3
src/d3/index.js
vendored
@ -1,7 +1,8 @@
|
||||
import createSceneData from './createSceneData.js';
|
||||
import createScene from './createScene.js';
|
||||
import RenderChain from './RenderChain.js';
|
||||
import ToonShaderRenderChain from './ToonShaderRenderChain.js';
|
||||
import ShapeMesh from './ShapeMesh.js';
|
||||
import ShapesManager from './ShapesManager.js';
|
||||
|
||||
export { createSceneData, createScene, ToonShaderRenderChain, ShapeMesh, ShapesManager };
|
||||
export { createSceneData, createScene, RenderChain, ToonShaderRenderChain, ShapeMesh, ShapesManager };
|
||||
|
Loading…
Reference in New Issue
Block a user