home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / graphics / 13191 < prev    next >
Encoding:
Internet Message Format  |  1992-12-24  |  3.7 KB

  1. Path: sparky!uunet!wupost!tulane!uflorida!math.ufl.edu!maple.circa.ufl.edu!X9999BVJ
  2. From: x9999bvj@maple.circa.ufl.edu
  3. Newsgroups: comp.graphics
  4. Subject: Re: Ordered triplets->homogenized vectors
  5. Message-ID: <1992Dec23.023807.27609@math.ufl.edu>
  6. Date: 23 Dec 92 02:38:07 GMT
  7. References: <38000@uflorida.cis.ufl.edu>,<1992Dec22.051616.1811@cis.uab.edu>
  8. Sender: news@math.ufl.edu
  9. Reply-To: X9999BVJ@oak.circa.ufl.edu
  10. Organization: Center for Instructional and Research Computing Activities
  11. Lines: 85
  12.  
  13. In article <1992Dec22.051616.1811@cis.uab.edu>, sloan@willis.cis.uab.edu (Kenneth Sloan) writes:
  14. >In article <38000@uflorida.cis.ufl.edu> sdk@reef.cis.ufl.edu (Steven "Scrib" Kuck) writes:
  15. >
  16. >Beware of cookbooks.  You need a graphics textbook.  For this
  17. >subject, I recommend Newman&Sproull - but any decent text will do.
  18.  
  19. Believe it or not, I have several good graphics textbooks, including
  20. Foley and Van Dam, David F. Rogers', etc.  The TI book is REAL good
  21. because it isn't just a bunch of library routines == I don't even own
  22. a TI based board ( which is required for the routines ).  It does
  23. a VERY good explanation of what basic 3d is about.  It just overlooked
  24. this one point ( not bad for about a 20 page intro ).
  25.  
  26. >STOP!  Think! 
  27. >
  28. >Question: What does it mean for a point fo have "an initial Z value
  29. >          of 0"?  
  30. >
  31. >Answer: this point is directly alongside the eyepoint.  It is neither in
  32. >front of, nor behind the eye.  In order to "see" this point, you would
  33. >need a 180deg field of view.
  34. >
  35. >Question: Where in the image plane will this point project?
  36. >
  37. >Answer: either the projected x value, or the projected y value, or both,
  38. >will be infinite.  This looks bad.
  39.  
  40. Yes, this POINT will project infinitely.  The problem is that the point
  41. can be part of a line, and thus it needs to be clippped.  I'm using a
  42. derivative of the Sutherland-Hodgman clipping algorithm extended to
  43. three dimensions, and it works for the most part.  You see, when you
  44. have a line from, say, 10,0,0 to 0,0,100, you CAN see it....I can't
  45. just ignore the first vertex because its Z value is 0!  It needs to be
  46. clipped into the canonical view volume so that it IS a valid point,
  47. which is why I'm using a canonical view volume and homogenous coordinates
  48. in the first place!
  49.  
  50. >>... then W becomes zero, and when I try to divide out by W, I get a divide
  51. >>by zero....
  52. >
  53. >
  54. >Which turns out to be correct, more or less.  Not the answer you want -
  55. >but correct nonetheless.  
  56.  
  57. Yes, that is correct, assuming that the POINT IS BEING CLIPPED, not a LINE
  58. with the point as one of its endpoints.
  59.  
  60. >Back to our Extra Credit Question.  After a little thought (or perhaps
  61. >some experimentation) you will discover that you cannot apply the
  62. >perspective transformation to points with an initial Z value *less than
  63. >or equal* to 0.  You must CLIP BEFORE PERSPECTIVE.
  64. >
  65. >Next, you will decide that it is bad news to divide by even very small
  66. >positive values.  Instead of clipping against Z==0.0, you should clip
  67. >against Z==hither - where the value of "hither" depends on other
  68. >parameters.  All we know so far is that "hither" should be larger than
  69. >the smallest number you feel comfortable dividing by.
  70.  
  71. I am aware of all this.  I DO clip before perspective.  Here is the pipeline:
  72.  
  73.     local*
  74.       |
  75.     world*
  76.       |
  77.     camera*
  78.       |
  79.         trivial rejection/acceptance
  80.       |
  81.     clip3D^
  82.       |
  83.     project^
  84.  
  85. * ordered triplets
  86. ^ homogenous vectors
  87.  
  88.  
  89. The problem still stems that my ordered->homogenous transformation ( done
  90. before clipping ) assumes a Z >= 0, which won't cut it.  Because although
  91. it works wonderfully up until projection, it still pukes.  It pukes
  92. because in order to "unnormalize" the vector,  I divide by the fourth
  93. element ( when Z is 0 , W is 0 ) and get a divide by 0.  See?
  94.  
  95. Anyway, more info is appreciated.
  96.  
  97. Brian
  98.