home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / graphics / 11732 < prev    next >
Encoding:
Internet Message Format  |  1992-11-11  |  2.3 KB

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