Submission for Unix-PC

Scott Hazen Mueller scott at zorch.SF-Bay.ORG
Sat Nov 18 09:32:35 AEST 1989


Does anyone know of a graphics package for the UNIX PC which lets me draw
2 dimensional graphics primitives (lines, circles, polygons, etc.) in
device coordinates (i.e. coordinates of points give the scan line and pixel
position within a scan line).

I've been trying to do this kind of thing using VDI, but it is very cumbersome
to second guess precisely what virtual coordinate will get mapped by VDI
into a particular device coordinate.  I've had to look at the work_out[]
array after doing a v_opnwk() call to find out maximum addressable NDC space
coordinates on x and y axes, maximum addressable width of screen/plotter in
rasters/steps, and maximum addressable height of screen/plotter in rasters/
steps.  Every time I want to refer to a device coordinate I have to do
a multiplication and a division to convert it to an NDC coordinate.  Internal
to the VDI software presumably another multiplication and another division is
done to convert the NDC coordinate back into a device coordinate so that
rending can be done to the device.  There are cases in which if the application
program in very careful the device coordinate it really wants and the one the
VDI software comes up with after a double conversion can be off by one, which
in some cases is significant.

I have been tempted to built my own device coordinate graphics primitive
library, which would render things into a main memory bitmap which is the
size of the bounding box of the object being rendered (or actually slightly
larger in some cases to make word boundaries line up) and then BLT the main
memory bitmap to the screen using the ioctl call which does this.

However, I'd really rather not spent the time and effort re-inventing the
wheel if there already is a device coordinate oriented graphics package for
the UNIX PC.

Please reply to this via e-mail to me as I don't have access to the unixpc
newsgroups.

Thanks in advance,
-Michael Aramini
 work:  aramini at apollo.com  -or-  ...!apollo!aramini
 home:  ...!apollo!mja!aramini



More information about the Unix-pc.general mailing list