Re: Drawing circles on digital terrain

New Message Reply Date view Thread view Subject view Author view

From: Allan Schaffer (allan++at++southpark.engr.sgi.com)
Date: 06/28/2000 09:26:25


On Jun 28, 9:43am, Chris Delnooz wrote:
> I am working on a 3D tactical display, in which radar tracks are visualised
> by appropriate models (aircrafts, ships etc.). I used to have a map textured
> on the ground plane and I could draw "radar circles" on that same plane.
> Those circles have their origin at my own ship and indicate the radar
> ranges.
>
> I now have replaced the map with a digital terrain database (in flt format)
> which works out quite nice. But now I can't see the circles anymore because
> they are still drawn on 0-level and lay most of the time "below" the
> terrain. I need a way to draw those circles on the terrain surface.

If these radar circles are essentially 2D elements that should appear
overlaid on other geometry then you could do a few Z-buffer tricks so
they will always show through.

Have a look at the DrawChannel() routine in the 'text.c' sample
program in /usr/share/Performer/src/pguide/libpf/C, it shows how
to draw text "on top" of other objects in the scene; you would replace
the drawXFontString() parts with your circle-drawing code.

> Now, I read something about an "Intersection Traversal" so I got the idea to
> represent my circles by cylinders and then draw the intersection with the
> cylinders and the terrain. However I don't no how I can implement such
> intersection calculations.

You could also do this (but it seems harder); see the intersect.c
sample in the same directory as above for intersection routines.

Allan

-- 
Allan Schaffer                                            allan++at++sgi.com
Silicon Graphics                           http://reality.sgi.com/allan


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Jun 28 2000 - 09:26:32 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.