Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

ray_song

Simulated Radar Screen

This topic is 6279 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

I''m going to make a simulated radar screen, which needs to draw a huge quantity of points(which keeps changing) and some static images. The QUESTIONS are: 1. What''s the fastesr way to draw these points? I suppose to draw on a offscreen surface, which only needs to update a scanline at a time, then blit to the screen at normal rates (eg, 50 Hz) 2. I use sprites of DX8(D3DXSPRITE) for static images, but when drawing big images, such as a background of 1152*864, it collapsed. How can I fix it? And How can i draw a transparent image with no COLORKEY available now? 3. Does any one knows where to get some assembly code for drawing lines, circles and ellipses in DX7? Thanks a lot.

Share this post


Link to post
Share on other sites
Advertisement
funny - I was just thinking about a solution I sent to someone involving doing this in OpenGL...

His question had to do with drawing the sweep, not drawing tons of points...

Questions:
1. how many points - 10s, 100s, 1000s?
2. do you have hardware constraints (ie. do you need this to work on ancient cards?)

Quick explanation...
0. Use DX8 - you should be able to draw 1000s of points on decent hardware at 100s of fps. For the images you may need to work around limitations (maybe)
1. Put your points in a big ol'' vertex buffer and render them as points
2. Explain your "collapse"... Also, check the "previously featured articles" for 2D drawing with DX8
3. You can simulate a sweep with some clever textures and alpha blending.
4. If you are doing the sweep thing, perhaps you could intelligently limit your points?
5. Assuming you''ve got decent hardware, I''m betting there is some really good line drawing assembly code running in the firmware...

Post more details and I''ll add what I can...

Share this post


Link to post
Share on other sites
The hardware is ok: Athlon 900 and Geforce FTS Pro,
The sweep has a radius of 400 points, actually it got 1000 scan lines per second. But considering its sweep speed, but I try to limite it only to draw new points, about 100 lines per second-- that's 40000 points.
But when using DX8, I don't know how to use a offline surface to keep old images, then the whole sweep surface must be redrawn, where it became a disaster.
The main question here is how to blit a transparent surface to display. I've searched a lot, but can't find the solution.
The background image I load to the sprite strangely streched the left-top portion to the whole surface-- I use only routine functions to load it from file and draw it.
And the last is that I think draw vertexes for points and ellipses is not as fast as write to surface directely as one wuold use in DX7. I got some code but it's VC, with so much to be repaint, I hope to make it ASM codes, do you know somewhere to get it ? Though DX8 is newer, I'd prefer DX7 for the situation. Much more easily surface copies , blending and points drawing.
And another thing is that I paint the dials and ticks up the radar sweep. There are four circles and 360 ticks for per degree, so If i use DX8 and draw them in Render(), it cost a lot as vertecis. I do hope to draw the sweep on a surface in one thread, which updated frequentelly, and blit it to display in another thread, which wuold run with less frequency. But how to create a large sprite and then draw points on it?
Thanks again for answering.


Edited by - ray_song on September 6, 2001 1:46:34 AM

Share this post


Link to post
Share on other sites
Hmmm... if you have a geForce, then we should be OK talking about DX8...

Am I misunderstanding the situation? I''m thinking there is a radar screen where the points are airplanes (for instance). Therefore the radius, etc, doesn''t matter - the real question is "How many "airplanes?" My guess is that it is less than 40000.

Once you talk about DX8, the whole idea of "blitting" goes away and drawing transparent textures becomes trivial.

About the speed of drawing vertices... That''s the whole point of the hardware! In most cases, an ellipse (created with a linestrip) will be MUCH faster than any pixel-by-pixel operation. If you create an ellipse with 1000 sides, that''s 1000 vertices. The geForce should be able to draw many thousands of those every second!

DX8 maybe harder, but in this case I think it''s a MUCH better choice... No offense, but my strong suspicion is that you are making some suboptimal decisions/assumptions (based on my understanding of the stated problem).

The way I did this in OpenGL:
1. Render a big textured quad with your pretty background picture
2. render all the radar blips (airplanes or whatever)
3. render a rotating gradient sweep over everything.

If the sweep texture is done correctly, you can actually get the nice brighten up, fade away CRT effect. On geForce class hardware, mine ran in the 100s of fps.

Share this post


Link to post
Share on other sites
Glad to see that seems we are doing sth with same purpose.
Unfortunatelly, I''m not drawing airplanes, but the raw radar echos, that is the primitive radar PPI display. As you should know, on this screen, one target is not one point, but a cluster of points, and a lot of clutter points too. That''s the reall problem, tens of thousands points to be updated. With only targets(planes), I''ve done it in OpenGL too. But here it''s too difficult.
Sorry for the inconvinience that i modified my last message. There I proposed that 2 threads to be implied, or i don''t think it possible to get a fluent update in a single thread.
If OpenGL can handle multiple surface, I would preffer it 2. But sorry for my ignorant, I even don''t know how to load a bitmap in OenGL. And the worse thing is that my program will eventually run on a Industrial PC. After days of search, I only got one type which supporte AGP card, so I have to choose 2D rather than 3D drawings.
well, I''ll try to find my codes and send to your mail, would it be ok?

Share this post


Link to post
Share on other sites
Hi,

If you are stuck doing it in 2D then I am probably not the best help.

One final thought: I think the person I helped before was able to read the data and precluster points before drawing them out to the screen. Would this reduce your drawing load?

Share this post


Link to post
Share on other sites
Actually, I do prefer some functions provided by 3D drivers such as scaling. But I don''t know how to make a surface in OpenGL as in DX7. I''m not even sure about that it provides this function. Maybe I can use it as texture? Too much overhead to be done. So if there is a easy way to keep the old drawing and repaint it, I would be glad to use that. Whether 3D or 2D, whether DX or OpenGl.
Maybe you can list some key functions and procedures in OpenGl?
Thanks again and again.

Share this post


Link to post
Share on other sites
Again... not *completely* sure I understand your limitations, but...

One thing you can do in both DX is render to a texture (in OpenGL it would be a pbuffer). In this case you could render your points to a texture and then continually redraw that texture on the screen as a textured quad.

Share this post


Link to post
Share on other sites
well if you are gonna draw a radar screen like a military type with a circle and a sweeping line going from the center and sweeping around the circle all u need to do is check to see that a cordinate makes contact with the sweeper. now if u want to make a real-time air traffic control radar its a bit more complex.


u know i was supprised to see an airtraffic controller game at bestbuy the other day and it was funny to see cause i couldnt imagine playing a game like that having it be fun. unless they had a kind of die hard 2 mode on it i guess.

Share this post


Link to post
Share on other sites

  • 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!