[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Help with Color on a Mac II
- To: firstname.lastname@example.org
- Subject: Help with Color on a Mac II
- From: email@example.com (Steve Kaisler)
- Date: Mon, 22 Apr 91 13:55:23 edt
To All Readers:
I request help in doing some color graphics on a Mac II.
I am developing a scanline, Z-buffer algorithm for a computer graphics
class. In certain instances, the color is set correctly, but in others
I cannot get the color set no matter what method I try.
Has anybody had similar problems, have any suggestions, or know of any
vagaries in MACL with respect to color.
In one version o fmy code, which works OK, I do the following:
(ask *gw* (set-fore-color (aref *image-buffer* x)))
where: *gw* is my window
*image-buffer* stores one of the 16 basic colors
represented in MACL (see page 158 of the manual)
This works OK. Each polygon gets the appropriate color
and appears on the screen.
Now, in the second version, I want to apply both illumination
and shading models to an object. Here, I use the folllowing
(setq aColor (make-color (round (* red-component 65536)) ....))
(ask *gw* (set-fore-color aColor))
where red-component is in the interval [0,1] and ... indicates
the same for green and blue components.
All this produces (rather consistently) is black pixels on the screen.
When I do a GET-FORE-COLOR after setting the foreground color as above,
it returns a value of 0! That is, the color is not set.
I need to vary the intensity of the color because the illumination
and shading models generate different effects based on a variety
If anyone has any ideas, suggestions, comments, or similar code
they would be greatly appreciated.