home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / graphics / 12159 < prev    next >
Encoding:
Internet Message Format  |  1992-11-20  |  3.3 KB

  1. Xref: sparky comp.graphics:12159 comp.graphics.visualization:1794 comp.graphics.explorer:334 comp.sys.sgi:16702 comp.graphics.animation:1076 comp.windows.x.intrinsics:554
  2. Newsgroups: comp.graphics,comp.graphics.visualization,comp.graphics.explorer,comp.sys.sgi,comp.graphics.animation,comp.windows.x.intrinsics
  3. Path: sparky!uunet!wupost!emory!swrinde!ringer!cqu
  4. From: cqu@ringer.cs.utsa.edu (Chang-ning Qu)
  5. Subject: Help needed about the Normal System.
  6. Message-ID: <1992Nov20.200847.4985@ringer.cs.utsa.edu>
  7. Organization: University of Texas at San Antonio
  8. Date: Fri, 20 Nov 1992 20:08:47 GMT
  9. Lines: 80
  10.  
  11.  
  12.    Hi, there is a 3D American map demograph with the
  13.    48 states' population and income data on Indigo
  14.    machine. It has four display options: draw line,
  15.    draw top, draw solid and draw lighted. We have
  16.    the original code and we are trying to modify it
  17.    to be a Texas county(254) map. After figuring out  
  18.    the data structure, we created a binary file, 
  19.    "counties.bin", with normal system as follows for
  20.    side faces:  
  21.  
  22.        taking any consecutive points (x1,y1,1) and 
  23.        (x2,y2,1) on the top, it could create a side 
  24.        face by adding (x1,y1,0) and (x2,y2,0). So 
  25.        the normal of the face could be determined by :
  26.  
  27.                         |   i     j     k |
  28.    ----->   ->   ->     |                 |
  29.    Normal = L2 X L1 =   | x1-x2  y1-y2  0 |                                     
  30.                         |                 |
  31.                         |   0     0    -1 |
  32.  
  33.             = - (y1-y2)i + (x1-x2)j + 0k
  34.                           
  35.             = [-(y1-y2), (x1-x2), 0] 
  36.    
  37.    then the normalized normal is
  38.  
  39.        -->     -(y1-y2)    x1-x2
  40.         n  = ( --------,  --------, 0 )
  41.                  NORM      NORM
  42.  
  43.                                       2         2
  44.    where  NORM= square root[(-(y1-y2)) + (x1-x2) + 0]
  45.  
  46.  
  47.                           Z
  48.                           ^
  49.                           |
  50.                     ______________
  51.                    |\    1|       \         
  52.              (x1,y1,1)_____________\(x2,y2,1)
  53.                    | |    | <-- |  |
  54.                    | ||   |  L2 |  |  
  55.                    | |v   |     |  |  
  56.                    | |L1  |     |  |
  57.                    | |    |     |  |
  58.                    |_|____|_____|  |
  59.                    \ |   0|_ _ _ \_|_ _ _ Y
  60.                     \|___/________\|
  61.                (x1,y1,0)/      (x2,y2,0) 
  62.                        /
  63.                       /
  64.                      X             
  65.     
  66.  
  67.    The problem is that we couldn't get correct illumination
  68. when displaying in draw-solid and draw-lighted, they are just
  69. reversed (lighted sides to be dark and dark becoming lighted)!
  70.    
  71.     The normal system of the original code seems using
  72.  
  73.        -->      x1-x2     -(y1-y2)
  74.         n  = ( --------,  --------, 0 )
  75.                  NORM       NORM
  76.  
  77.  but it can't make any sense why they calculated in that way!
  78. and we have tried all possibilities of the normal system 
  79. (including their way!), unfortunately, none of them works!
  80. We began to doubt there might be something wrong in the normal
  81. system of the original programs and they were fixed in somewhere
  82. else?
  83.  
  84.     Could anyone help us to figure out what wrong it is? Or 
  85. any suggestion? Thank you in advance.
  86.  
  87. Charlie Qu
  88. FACTT Center
  89. Univ of Texas at San Antonio   
  90. E-mail: charlie@nacho.cr.utsa.edu
  91.