   Simulating a radar in 3D environment
  For a project, I have to simulate a radar in a 3D environment. I've a (huge)terrain + objects (mostly irregular) scattered in the environment (all meshes).When I think of implementing(a _simulation_) it, only ray tracing comes to mind. But I get stuck with collision detection (the time complexity). One method could be to have simplified models generated (using edge collapses in progressive mesh technique?) for each mesh, and then try ray tracing to improve performance?I've read about the orthogonal projection technique. To add characteristics of a radar image (eg. resolution, colors etc), I could do post projection image processing to get the real thing?Another thing I had in mind was to maybe keep the transmitter and receiver in the environment as separate entities?Can anybody suggest me a better method of going about it/point me to some resources?TIA   
  A 'typical' game radar system (say, a graphic with icons representing the positions of objects) can be implemented easily enough, but it sounds like you have something more complicated in mind. For the benefit of those of us who aren't up to speed on how radar works (beyond the basics, that is), perhaps you could provide some more information. Are you talking about simulating the details of object-radar interaction, such as occlusion, object profile, material properties, and so on?   ;  Assuming it is not real-time, raytracing would work fine. Just intersect the ray with the object's bounding box, and if it hits test the ray against each of the triangles in the object.   ;  If you want to simulate the "radial sweep" style of radar you could use a combination of frustum culling and ray-tracing:Say the radar device is located at a point P and you want to simulate a radar sweep 360 degrees about the point P about the Y axis. Break up the circular sweep into N chunks (e.g. 32) with each chunk having a "field of view" of 360/N degrees. Start with the first chunk (0 degrees to 360/N degrees) and build a frustum covering that chunk (the same as you would do for a camera) and cull your detectable objects against that frustum. Next perform a series of ray-traces from the point P to each object within the frustum to check the visibility of that object to P (so you don't detect occluded objects). As time progresses just move onto the next chunk.To display this information in a traditional radar style you could use two radar renderable textures. Two textures are used so you can simulate the behavior of a radar screen better - with objects scanned some time ago gradually being darkened to black.Each time you find the objects within a chunk:* Render Previous radar texture to Current one with some darkening factor applied.* Render detected objects (or a simplified version of each one) into Current texture using an orthographic (parallel) projection (with P being at the textures center) and a green material.* Use the Current texture for the radar device model.* Swap Previous and Current textures.You could also add some code to simulate the "sweep" better if you wanted or add in a blur at some point.This would definitely work, although it may not be suitable for your needs depending on your target hardware and the speed of frustum culling and ray-tracing in your code (although those are both very common operations for rendering and AI so should be pretty optimised already).Hope this helps,Mike.   ;  Actually, my post was somewhat over-complex!!Just render to one texture and render to the screen using a circular fan, setup to multiply the texture by vertex colour and set the vertex colour of each vertex to be dependant on the current direction of the radar...   ;Quote:Original post by jykFor the benefit of those of us who aren't up to speed on how radar works (beyond the basics, that is), perhaps you could provide some more information. Are you talking about simulating the details of object-radar interaction, such as occlusion, object profile, material properties, and so on?Well, what I want to do is the basics. Send a pulse(ray?) from the transmitter, and on collision, the point is detected on the receiver (another ray? if receiver.location!=transmitter.location). The signal strength attenuates while travelling in the medium. So if its air, it attenuates as factor 1, if its rain (water), it is factor 2. (btw, attenuation is also a factor of frequency of signal). Rain could be a mesh which is not visible?I'm _assuming_ right now that the reflected signal can be a property of the texture of material. I'm not trying to do an object radar interaction, rather the propogation of pulse.The display of a radar like output wouldn't be a problem.MikeWW, I'm assuming you mean to say that on a separate buffer, I define a new view where the viewing frustrum is defined such.Quote:Next perform a series of ray-traces from the point P to each object within the frustum to check the visibility of that object to P (so you don't detect occluded objects).How do I get a list of all objects within the frustrum?BTW, since radars also have a resolution, and they take the average of pulse energies received from a particular direction (several pulses are sent), I was thinking that I could reduce the number of rays by sending few randomly directed rays in each sector(resolution).Ideas?;  Once I do a projection transform (using Z buffer), can I read the Z buffer values?   