• Create Account

# how to draw threat dome

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

6 replies to this topic

### #1A9876  Members   -  Reputation: 88

Like
0Likes
Like

Posted 18 June 2012 - 02:24 AM

Hi

I want to implement a threat dome.

So I am hoping some one could help me on this.

### #2larspensjo  Members   -  Reputation: 1561

Like
0Likes
Like

Posted 18 June 2012 - 03:05 AM

I want to implement a threat dome.

So I am hoping some one could help me on this.

Please explain what a threat dome is, and what your requirements on functionality are.
Current project: Ephenation.
Sharing OpenGL experiences: http://ephenationopengl.blogspot.com/

### #3A9876  Members   -  Reputation: 88

Like
-2Likes
Like

Posted 18 June 2012 - 04:10 AM

A9876

Edited by A9876, 18 June 2012 - 06:39 AM.

### #4larspensjo  Members   -  Reputation: 1561

Like
0Likes
Like

Posted 18 June 2012 - 04:35 AM

Threat Dome displays the volume that is visible from a given point on the terrain. Threat Dome looks like top half of a sphere that accurately displays the areas viewable from the defined point. Any point inside the threat dome can be viewed from the dome’s pivot point.

I think this is what is called frustum then?

If you use OpenGL, the projection matrix will compute it for you.
Current project: Ephenation.
Sharing OpenGL experiences: http://ephenationopengl.blogspot.com/

### #5A9876  Members   -  Reputation: 88

Like
-2Likes
Like

Posted 18 June 2012 - 06:23 AM

A9876

Edited by A9876, 18 June 2012 - 06:38 AM.

### #6samoth  Crossbones+   -  Reputation: 8008

Like
0Likes
Like

Posted 18 June 2012 - 06:43 AM

If I understand correctly what you want, this is all but trivial.

You basically want to construct a dome from the visible horizon from some arbitrary point. This is easy if you know the horizon (just extrude towards +Z and scale, repeat a few times, and there's your dome), but finding the horizon line is not easy.

Assuming a heightmap terrain (you didn't specify, but otherwise it is still a lot harder!) this means you have to ray-march over the terrain heightmap up to a maximum viewing distance and ignore everything that is less than your maximum value (because something that is below a higher elevation won't be visible). So basically, you only ever care about values that are higher than any ones (including the point you're standing on) you've seen before. Anything less isn't visible as long as the terrain isn't transparent and doesn't have holes. Eventually you will have reached a maximum distance (either practical because it's no longer of interest, or for effects like atmospheric attenuation, earth curvature, etc.).

Do that for, say, a dozen cardinal directions. This is a very coarse approximation. If the terrain between two rays is sufficiently "similar", your estimate is good, the distance that you find on two sibling rays is identical or more or less the same. If it is not, then your estimate is not accurate, so shoot another ray at the half angle between the two, repeating this recursively until you are happy with the accuracy.

Edited by samoth, 18 June 2012 - 06:46 AM.

### #7A9876  Members   -  Reputation: 88

Like
0Likes
Like

Posted 19 June 2012 - 01:05 AM

If I understand correctly what you want, this is all but trivial.

You basically want to construct a dome from the visible horizon from some arbitrary point. This is easy if you know the horizon (just extrude towards +Z and scale, repeat a few times, and there's your dome), but finding the horizon line is not easy.

Assuming a heightmap terrain (you didn't specify, but otherwise it is still a lot harder!) this means you have to ray-march over the terrain heightmap up to a maximum viewing distance and ignore everything that is less than your maximum value (because something that is below a higher elevation won't be visible). So basically, you only ever care about values that are higher than any ones (including the point you're standing on) you've seen before. Anything less isn't visible as long as the terrain isn't transparent and doesn't have holes. Eventually you will have reached a maximum distance (either practical because it's no longer of interest, or for effects like atmospheric attenuation, earth curvature, etc.).

Do that for, say, a dozen cardinal directions. This is a very coarse approximation. If the terrain between two rays is sufficiently "similar", your estimate is good, the distance that you find on two sibling rays is identical or more or less the same. If it is not, then your estimate is not accurate, so shoot another ray at the half angle between the two, repeating this recursively until you are happy with the accuracy.

Thank You...

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

PARTNERS