Background color for SkyBox

160 views
Skip to first unread message

fab...@wurkhouse.com

unread,
Aug 18, 2018, 6:48:20 PM8/18/18
to cesium-dev
Has anyone any idea how to change the skybox to a simple white background color?

http://wurk.house/earth/Apps/spana.html

I have tried suggestion from:

https://cesiumjs.org/Cesium/Build/Documentation/SkyBox.html

But it doesn't change.

Thanks in advance for any help or guidance on this.

Scott Reynolds

unread,
Aug 19, 2018, 1:35:44 PM8/19/18
to cesium-dev
Since the SkyBox uses images, just supply a single image with one white pixel for each of the box's sides.

var viewer = new Cesium.Viewer('cesiumContainer', {
    shouldAnimate : true
});

var scene = viewer.scene;

scene.skyBox = new Cesium.SkyBox({
  sources : {
    positiveX : '../../SampleData/WhitePixel.png',
    negativeX : '../../SampleData/WhitePixel.png',
    positiveY : '../../SampleData/WhitePixel.png',
    negativeY : '../../SampleData/WhitePixel.png',
    positiveZ : '../../SampleData/WhitePixel.png',
    negativeZ : '../../SampleData/WhitePixel.png'
  }
});

Scott

fab...@wurkhouse.com

unread,
Aug 19, 2018, 4:31:21 PM8/19/18
to cesium-dev
Hi Scott,

That worked perfectly.

Thanks so much for that info.

Much appreciated.

Reply all
Reply to author
Forward
0 new messages