|
-
Dec 16th, 2010, 03:55 AM
#1
-
Dec 16th, 2010, 08:18 AM
#2
Re: How calculate visibilty of objects
Sounds to me like a collision detection problem. How complex/realistic do you want to make this? How are you wishing to display this simulated radar?
Depending on how many objects you have and how you store there positions two approaches spring to mind (not accounting for noise, clutter, ghosting, interference etc)
1. Treat your beam as a series of bullets, plot the first object they hit. Standard collision detection. Could end up being rather intensive.
2. Create a 1D array representing the beam where the index represents the distance. Determine if potential targets are within the beam and if so mark them at the appropriate distance. Assuming a wedge shaped beam, the mark could indicate how much of the beam hits the object (1-255 say). Run through the marked beam (starting at distance 0) plotting found items, brightness given by mark - previous marks. Stop when either, previous marks >= maximum mark, or the maximum range is met.
-
Dec 16th, 2010, 08:38 AM
#3
Re: How calculate visibilty of objects
Hold it, hold it
I'm not going into that much.
I will only need to calculate if an object(or part of it) can be seen. No clutter, noise, side-lobes etc....
So far I use a formula for maximum (theoretical) range [1.3 * Sqrt(Altitude of Radar+Heigth of target[both in feet], in Nm), if the target is within this range it can be seen.
Now I'd like to mimic the effect of one target is behind another.
For this calculation all positions are known.
If that would be "rather intensive" I'll drop that idea, since I need that capacity in other parts of the application.
You're welcome to rate this post!
If your problem is solved, please use the Mark thread as resolved button
Wait, I'm too old to hurry!
-
Dec 16th, 2010, 08:59 AM
#4
Re: How calculate visibilty of objects
Can you show us a picture of how this radar will be displayed. I think the second approach is the most efficient. Are you simulating a rotating beam?
-
Dec 16th, 2010, 10:11 AM
#5
Re: How calculate visibilty of objects
 Originally Posted by Milk
Can you show us a picture of how this radar will be displayed. I think the second approach is the most efficient. Are you simulating a rotating beam?
No,it won't be that complicated. I will not reproduce a RadarDisplay!
I will just display symbols(for example just a square) if the calculation states a contact COULD have been gained. The actual display is just a 2D Map showing the postion of those symbols(objects).
Like PseudoCode:
Function RadarContact(ViewPosition, TargetPosition, OtherObjectPositions()) as Boolean
You're welcome to rate this post!
If your problem is solved, please use the Mark thread as resolved button
Wait, I'm too old to hurry!
-
Dec 16th, 2010, 12:59 PM
#6
Re: How calculate visibilty of objects
Ok, well, it sounds like you got your radar range due to planet curvature. It would also probably have an ultimate maximum too due to radar power.
For hiding targets, you just need to determine if they're on the same directional vector from the radar. Simple trig gets you the cone created by the masking effect: ATAN(TargetWidth/TargetDistance) = degrees of angle for the masking cone. Use that to get the two masking vectors. If a target is farther away than the masking target, and it's direction vector falls in between the two masking vectors, then it is hidden.
-
Dec 16th, 2010, 03:42 PM
#7
Re: How calculate visibilty of objects
Okay, I was stuck on the idea of a radar display and partially obscured objects. The tricky part of the problem to my mind was (is) not how do you determine if an object obscures another, that's pretty easy, but how do you check a bunch of objects without comparing every object to every other object.
Using...
Function RadarContact(ViewPosition, TargetPosition, OtherObjectPositions()) as Boolean
...strikes me as fine if there are not so many TargetPositions but potentially rather intensive if there are many. Assuming the same test is performed for every object then its O(n² complex.
This only need be an O(n) problem.
I'm going to bang on about beams again but bear with me. Consider an array of null references to potential targets where each element represents the radar beam at a particular angle. Loop through each target object and work out which element(s) of the Radar array point to the target, if the elements already reference a target work out which target is closest and assign the closest one. When it comes to rendering targets, just render the ones in the Radar array. All done in a single pass.
-
Dec 16th, 2010, 05:24 PM
#8
Re: How calculate visibilty of objects
Thanks for the ideas, I'm going to use both.
The Radar arry will keep the calculation in limits, however I need to check the complete masking(width and height) since my radar will be on a significant other height compared to the targets.
To calculate the masking by with is no problem, however the calculation of the vertical angle to the target is a new thing for me.
I'll get my head chrunched on that the net days.
Since the main problem is theoretically solved I'll close this one.
Thank you (Reps following, if I am allowed to rep you already again)
Edit: No Reps possible for Jenner, I'm sorry
You're welcome to rate this post!
If your problem is solved, please use the Mark thread as resolved button
Wait, I'm too old to hurry!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|