home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!uknet!canon.co.uk!ads
- From: ads@canon.co.uk (Adam Billyard)
- Newsgroups: comp.graphics
- Subject: Re: Drawing in the background.
- Message-ID: <1992Nov11.110043.11222@canon.co.uk>
- Date: 11 Nov 92 11:00:43 GMT
- References: <BxF4t6.AuF@CAM.ORG> <martin.721395535@marsh>
- Reply-To: ads@canon.co.uk
- Organization: Canon Research Centre Europe Ltd
- Lines: 45
-
- martin@cs.curtin.edu.au (Martin Dougiamas) writes:
-
- > gelinas@CAM.ORG (Daniel Gelinas) writes:
- >
- > >I was wondering if any of guys guys could help me out with something
- > >that I would like to try. The goal of my program( in C) is to draw
- > >4 laser beams(one from each corner of the screen) shooting out and
- > >spelling a word. My only problem is when I try to do this normally
- > >I have to use 1 function to draw a line in green, and then I use the
- > >same function to draw another line in black. This way the laser beam
- > >s can move around. That's all fine and dandy but it won't work with
- > >4 laser beams because when I write over them in black it also writes
- > >of everything else on the screen.
- >
- > A better way to do it would be to write the lines both times using
- > some sort of "Exclusive Or" mode... where it adds the line's pixels
- > to the screen using XOr logic. Then, just do exactly the same thing
- > again (ie call your same line-drawing routine) to REMOVE the line.
- >
- > On a Macintosh at least, it was very easy to to specify the drawing
- > mode and the system would do the logic for you. I'm sure there must
- > be something equivalent on most other systems.
-
-
- But if you want true loveliness, pats on the back from fellow workers,
- fame, fortune, all the gold you can eat etc etc, then you should use XOR
- but draw each of your 4 "laser lines" in a different logical (and
- bitwise) colour (eg 1,2,4 and 8). Then arrange your colour lookup table
- entries to be set up with colours such that the additive colours created
- as lines cross are the colour chosen for the "laser" colour.
-
- Put it another way, logical colour #0 should be (say) black, and logical
- colours #1 thru #15 should be a shade of laser green.
-
- Oh yes!
-
- Adam.
-
-
- -------------
- Adam Billyard, Graphics Division,
- Canon Research Centre Europe,
- 17/20 Frederick Sanger Rd, Surrey Research Park, Guildford, Surrey, GU25YD, UK.
- ads@canon.co.uk, ads@canon.uucp, ..!ukc!canon!ads
- Tel: +44 (0) 483 574325 Fax: +44 (0) 483 574360
-