how to make sure a CorridorGraphics color is really constant

39 views
Skip to first unread message

a...@daedalean.ai

unread,
Oct 18, 2018, 6:01:18 AM10/18/18
to cesium-dev
1. A concise explanation of the problem you're experiencing.

I'm drawing shapes on the ground using CorridorGraphics. I'm setting a color constant for the material, e.g. like this:


var foo = viewer.entities.add({
id: 'XXX',
name: 'name of XXX',
corridor: {
positions: Cesium.Cartesian3.fromDegreesArray([
lon1, lat1,
lon2, lat2
]),
width: ww,
cornerType: Cesium.CornerType.MITERED,
material: Cesium.Color.GREEN
}
});


when I render this, I see that the color rendered is not constant, but the RGB values vary a little bit, e.g. between (27, 138, 44), (25, 142, 35), (24, 144, 33), (25, 142, 35)

I'd like to have the corridor rendered so that the color rendered is actually constant, e.g. gives the same RGB value for each pixel in the corridor from all viewpoints


2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.

see above


3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

I'd like to record an animation of a scene with the corridors on it, with the corridors covering their area with same colored pixels


4. The Cesium version you're using, your operating system and browser.

1.50, Chrome, Ubuntu 18.04

Omar Shehata

unread,
Oct 19, 2018, 11:36:17 AM10/19/18
to cesium-dev
I think in Cesium's terms, "constant" usually refers to "constant over time". I think what you're thinking of is unlit shading, where the color isn't affected by light sources/the camera angle etc.. 

I think you'll need create a custom Appearance to get this effect (see this tutorial https://cesiumjs.org/tutorials/Geometry-and-Appearances/ ).

Here's a Sandcastle example I put together. If you tilt the camera, you'll notice the corridor on the right changes color, while the corridor on the left does not. 

Let me know if this is what you need!

Ákos Maróy

unread,
Oct 28, 2018, 4:10:27 PM10/28/18
to cesiu...@googlegroups.com
Omar,
On Fri, Oct 19, 2018 at 8:36 AM Omar Shehata <omar.same...@gmail.com> wrote:
I think in Cesium's terms, "constant" usually refers to "constant over time". I think what you're thinking of is unlit shading, where the color isn't affected by light sources/the camera angle etc.. 

I think you'll need create a custom Appearance to get this effect (see this tutorial https://cesiumjs.org/tutorials/Geometry-and-Appearances/ ).

Here's a Sandcastle example I put together. If you tilt the camera, you'll notice the corridor on the right changes color, while the corridor on the left does not. 

Let me know if this is what you need!


thanks, looks a lot better :)


Akos 
Reply all
Reply to author
Forward
0 new messages