Re: OG polygon to EPS problem [message #31939 is a reply to message #31935] |
Thu, 29 August 2002 15:43   |
Karl Schultz
Messages: 341 Registered: October 1999
|
Senior Member |
|
|
"David Fanning" <david@dfanning.com> wrote in message
news:MPG.17d81ca4bab3db5098998a@news.frii.com...
> Mirko Vukovic (mvukovic@taz.telusa.com) writes:
>
>> In the following program, if I have hidden_lines on, the post-script
>> is shaded black. If I have hidden_lines off, I can see the grid.
>> This is in IDL5.4.on WinNT. The behavior with hidden_lines on does
>> not make sense to me. Anyone else?
>>
>> My real application is a 3D polygon, with hidden lines on. However,
>> all I currently get is a black blob. If I use surface elevation
>> shading, hidden_lines have no effect, and I can trick IDL somewhat by
>> using black-white color map with the gamma correction at 10.
>
> I think it is a mistake to think "vector" output is going
> to work with polygons. I'd leave that keyword off, and then
> see if the rest of it makes sense. I can't really tell here
> what I am suppose to be seeing. :-)
I know what the problem is.
The short answer is to not try to do hidden line removal in vector mode.
Hidden line/hidden surface removal (HLHSR) is often thought of as a
"raster-space" operation, rather than a "vector" operation. That is, in
vector mode, vectors and shapes are drawn without considering what other
vectors or shapes have already been drawn. In vector mode, there is no
frame buffer or "raster space". Thus, we don't do HLHSR on a vector device.
The IDL docs do say that vector output is unable to reproduce certain
effects, such as shading and depth buffering operations. We sort things in
Z to make the best picture we can, however.
Here's why you see solid polygons when you turn on HLHSR. When drawing a
wireframe polygon in hidden-line mode, IDL first draws the polygon in fill
mode in the background color. These "invisible" faces block the parts of
the polygon that are behind the invisible faces. Then, when we draw the
wireframe in the specified color, the Z buffer "clips" out the part of the
lines that are behind the invisible faces, leaving just the lines that are
visible.
The reason why the polygons were black here instead of white is that the
temporary color override (to the background color) didn't make it out to the
vector output, and so they came out black. They should have been drawn
white. But even if they were white, they wouldn't do what they were
supposed to do in vector mode (no Z buffer), so I don't think they should be
drawn at all. I'll look into fixing this. It is better to just have the
wireframe draw without HLHSR than have the shield polygons draw.
Karl
|
|
|