import camera from
'./camera'
;
import light from
'./light'
;
import background from
'../objects/background'
;
class Scene {
constructor() {}
init() {
this
.instance =
new
THREE.Scene();
this
.camera = camera;
this
.camera.init();
this
.renderer =
new
THREE.WebGLRenderer({
canvas: canvas,
antialias:
true
,
});
const axesHelper =
new
THREE.AxesHelper( 100 );
this
.instance.add( axesHelper );
this
.renderer.setClearColor(
new
THREE.Color(0x000000));
this
.light = light;
this
.light.init();
this
.instance.add(
this
.light.instance.ambientLight );
this
.instance.add(
this
.light.instance.directionLight );
this
.instance.add(
this
.light.instance.shadowTarget );
this
.background = background;
this
.background.init();
this
.background.instance.position.z = 0;
this
.camera.instance.add(
this
.background.instance );
}
render() {
this
.renderer.render(
this
.instance,
this
.camera.instance);
}
}
export
default
new
Scene();