comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Line thickness & Z-buffer
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Line thickness & Z-buffer [message #16422] Wed, 21 July 1999 00:00
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
David Fanning (davidf@dfanning.com) writes:

> There has always been something weird about the Z-buffer.

By the way, notice that the test code I sent generates
error messages when executed in the Z-buffer:

IDL> test
% Program caused arithmetic error: Floating underflow
% Program caused arithmetic error: Floating illegal operand

I think this is also a manifestation of the underlying
resolution problem.

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Line thickness & Z-buffer [message #16423 is a reply to message #16422] Wed, 21 July 1999 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Simon Hall (shall@atm.ch.cam.ac.uk) writes:

> I draw some lines of thickness 2 (using plot) directly to a window and
> all is well, I get lines of thickness 2. However, I need to produce some
> 3000+ images for an animated sequence and rather than plot to a window
> I'm plotting to the z-buffer, reading that image with tvrd(), and
> writing a gif image. When I do so I get a bunch of lines of varying
> thicknesses. Horizontal and vertial lines seem fine, diagonal ones are
> noticably thinner.
>
> Can someone tell me how to get lines of uniform thickness (without
> plotting each segment separately) in a z-buffer-generated image???
>
> Using IDL 5.2 on NT4. I can provide an example.

There has always been something weird about the Z-buffer.
For example, it uses a different character size than normal,
so plot margins are slightly different, etc. I don't know
if there is something inherent in the resolution of the
device, or what, but I think this is a manifestation of
the same underlying problem.

In fooling around with this, though, I noticed that a
thickness of 2 is just about the *worst* thickness you
can use! Here is the code I used to play around. I found
a thickness of 2.75 gave reasonable results. You may
have to find something you can live with.

An alternative, possibly, would be to draw this
into a pixmap rather than into the Z-buffer.

Cheers,

David

PRO test
thickness = 2.75
window, xs=400, ys=400
data = loaddata(1)
plot, data, /nodata
Oplot, data, thick=thickness
Oplot, [0,101],[0,20], thick=thickness
plots, [0,100], [10,10], thick=thickness
thisDevice = !D.Name
set_plot, 'z'
device, set_resolution=[400,400]
plot, data, /nodata
Oplot, data, thick=thickness
Oplot, [0,101],[0,20], thick=thickness
plots, [0,100], [10,10], thick=thickness
snap = tvrd()
set_plot, thisDevice
window, 1, xs=400, ys=400
tv, snap
END

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Using C++ classes with IDL
Next Topic: Line thickness & Z-buffer

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:17:19 PDT 2025

Total time taken to generate the page: 0.00589 seconds