-
-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Description
To make a lib a better Threejs player we should allow Threejs primitives to be customized via the public api.
Care need to be taken not to be merely passing many options.
This includes:
- Scene
- Renderer
- Camera
- Controls
- Lighting settings
- Fog
We can either
- expose these objects as props
- allow a primitive to be injected via the constructor
- allow them to be customized via new constructor arguments (ex 'sceneOpts')
We can define an approach per case.
Some examples:
1 exposing as prop
If we expose the scene, it can be customized
const preview = new GCodePreview({ ... });
preview.scene.fog = new THREE.Fog( 0xcccccc, 10, 15 );
2 inject
For something like fog it makes sense to allow it to be injectable by itself
const preview = new GCodePreview({
fog: new THREE.Fog( 0xcccccc, 10, 15 )
});
3
const preview = new GCodePreview({
sceneOpts: {
fog: new THREE.Fog( 0xcccccc, 10, 15 )
}
});
Reactions are currently unavailable