From 4ede0ea6d248f3f07fddff88fe25ed726244fe01 Mon Sep 17 00:00:00 2001 From: martinRenou Date: Mon, 31 Aug 2020 09:41:31 +0200 Subject: [PATCH 1/2] Change default opacity and color of the background Signed-off-by: martinRenou --- ipygany/ipygany.py | 4 ++-- src/widget.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ipygany/ipygany.py b/ipygany/ipygany.py index f760026..2f2e4ed 100644 --- a/ipygany/ipygany.py +++ b/ipygany/ipygany.py @@ -486,8 +486,8 @@ class Scene(_GanyDOMWidgetBase): children = List(Instance(Block)).tag(sync=True, **widget_serialization) - background_color = Color('#fff').tag(sync=True) - background_opacity = CFloat(0.).tag(sync=True) + background_color = Color('white').tag(sync=True) + background_opacity = CFloat(1.).tag(sync=True) def __init__(self, children=[], **kwargs): """Construct a Scene.""" diff --git a/src/widget.ts b/src/widget.ts index 30834ae..4a459a3 100644 --- a/src/widget.ts +++ b/src/widget.ts @@ -713,8 +713,8 @@ class SceneModel extends _GanyDOMWidgetModel { return {...super.defaults(), _model_name: SceneModel.model_name, _view_name: SceneModel.view_name, - background_color: '#fff', - background_opacity: 0., + background_color: 'white', + background_opacity: 1., children: [], }; } From 8822589085b705d3d0238fd8f0b15f7a8c8ebce8 Mon Sep 17 00:00:00 2001 From: martinRenou Date: Mon, 31 Aug 2020 12:34:26 +0200 Subject: [PATCH 2/2] Update GanyJS 0.6.0 Signed-off-by: martinRenou --- package-lock.json | 6 +++--- package.json | 2 +- src/widget.ts | 8 ++++++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6fb0bfa..08bc083 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2745,9 +2745,9 @@ "dev": true }, "ganyjs": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/ganyjs/-/ganyjs-0.5.0.tgz", - "integrity": "sha512-qAHgYGDxM3AjeL4wFCClecSdxBG7MPMU5l1UCh5Q/Nbea5ooiyb0JUkDRSBTObER3VBT9B6xI4+yWBcmMsPAAA==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/ganyjs/-/ganyjs-0.6.0.tgz", + "integrity": "sha512-Ing8lms4AvdOJwS7SIJltJF0qWd8H2BET3wuRizhM9h6EH/RkxQUdLPPpdt3SzbiBeiTdE45YtrDqfetJ2IAdg==", "requires": { "backbone": "^1.4.0", "binary-search-tree": "^0.2.6", diff --git a/package.json b/package.json index 2d15290..e6433ba 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "@jupyter-widgets/controls": "^2.0.0", "backbone": "^1.4.0", "binary-search-tree": "^0.2.6", - "ganyjs": "^0.5.0", + "ganyjs": "^0.6.0", "three": "^0.118.0", "uuid": "^3.3.3" }, diff --git a/src/widget.ts b/src/widget.ts index 4a459a3..b67649c 100644 --- a/src/widget.ts +++ b/src/widget.ts @@ -680,10 +680,18 @@ class WaterModel extends EffectModel { } createBlock () { + // TODO Add texture to the package + const url = 'https://raw.githubusercontent.com/martinRenou/threejs-caustics/master/assets/TropicalSunnyDay_'; + return new Water(this.parent.block, { underWaterBlocks: this.underWaterBlocks, causticsEnabled: this.causticsEnabled, causticsFactor: this.causticsFactor, + skybox: new THREE.CubeTextureLoader().load([ + url + 'px.jpg', url + 'nx.jpg', + url + 'py.jpg', url + 'ny.jpg', + url + 'pz.jpg', url + 'nz.jpg', + ]), }); }