Jump to content
  • Advertisement
Sign in to follow this  
amrin

how to draw threat dome

This topic is 2218 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

[color=#000000][font=verdana, arial, helvetica][size=2]

Hi

[/font]

[color=#000000][font=verdana, arial, helvetica][size=2]

I want to implement a threat dome.

[/font][color=#000000][font=verdana, arial, helvetica][size=2]

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

[/font]

[color=#000000][font=verdana, arial, helvetica][size=2]

Thanks in advance

[/font]

Share this post


Link to post
Share on other sites
Advertisement

[color=#000000][font=verdana, arial, helvetica][size=2]I want to implement a threat dome.[/font]


[color=#000000][font=verdana, arial, helvetica][size=2]So I am hoping some one could help me on this.[/font]



Please explain what a threat dome is, and what your requirements on functionality are.

Share this post


Link to post
Share on other sites
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 [color=#FFFFFF][background=#0a246a]threat dome[/background] 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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

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...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!