Subscribe to this thread
Home - General / All posts - M9 - Viewsheds for Shadows
atrushwo82 post(s)
#19-May-22 14:00

Hey Everyone,

I was trying out viewsheds for the first time to create shadows for terrain rendering. I managed to get everything working; however, I noticed that the observer point has to be on the surface. This was creating issues for me as the shadows would be cast in different directions. I imagine that grossly expanding the surface would be an adequate workaround; however, it seems rather clunky and unnecessary.

Is there any way to modify the code to allow for observer points to be outside the bounds of the raster?

Thanks!

Attachments:
No Shadows.JPG
Shadows.JPG

Dimitri

7,025 post(s)
#20-May-22 06:19

That's a really great effect! For observer points outside the raster, I'd just make the raster bigger, with the additional regions being nodata/null values in pixels.

adamw

10,011 post(s)
#20-May-22 13:58

Adding to what Dimitri is saying: you can make an image bigger simply by editing its Rect property.

atrushwo82 post(s)
#25-May-22 15:43

Thanks Guys, These suggestions worked; however, I will attest that it does feel unnecessary to do so. For anyone else reading this, edit the Rect property as Adam suggested, then run the following code.

TABLE CALL TileFillBaseLevel([SURFACE]);

UPDATE [SURFACE] SET [Tile] = CASTV(TileMake(128, 128, NULL) AS FLOAT32) WHERE [TILE] IS NULL

tjhb

9,976 post(s)
#25-May-22 19:23

Oooh nice. Two different meanings of "NULL" in one query!

Making NULL orthogonal to itself? Not really.

What the UPDATE query means, in plain English, is: "Replace each tile (within the scope of Rect) which is currently NULL, with a non-NULL tile made up of NULL pixels."

(OK, somewhat plain English.)

Manifold User Community Use Agreement Copyright (C) 2007-2021 Manifold Software Limited. All rights reserved.