home *** CD-ROM | disk | FTP | other *** search
- 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
- Newsgroups: comp.graphics,comp.graphics.visualization,comp.graphics.explorer,comp.sys.sgi,comp.graphics.animation,comp.windows.x.intrinsics
- Path: sparky!uunet!wupost!emory!swrinde!ringer!cqu
- From: cqu@ringer.cs.utsa.edu (Chang-ning Qu)
- Subject: Help needed about the Normal System.
- Message-ID: <1992Nov20.200847.4985@ringer.cs.utsa.edu>
- Organization: University of Texas at San Antonio
- Date: Fri, 20 Nov 1992 20:08:47 GMT
- Lines: 80
-
-
- Hi, there is a 3D American map demograph with the
- 48 states' population and income data on Indigo
- machine. It has four display options: draw line,
- draw top, draw solid and draw lighted. We have
- the original code and we are trying to modify it
- to be a Texas county(254) map. After figuring out
- the data structure, we created a binary file,
- "counties.bin", with normal system as follows for
- side faces:
-
- taking any consecutive points (x1,y1,1) and
- (x2,y2,1) on the top, it could create a side
- face by adding (x1,y1,0) and (x2,y2,0). So
- the normal of the face could be determined by :
-
- | i j k |
- -----> -> -> | |
- Normal = L2 X L1 = | x1-x2 y1-y2 0 |
- | |
- | 0 0 -1 |
-
- = - (y1-y2)i + (x1-x2)j + 0k
-
- = [-(y1-y2), (x1-x2), 0]
-
- then the normalized normal is
-
- --> -(y1-y2) x1-x2
- n = ( --------, --------, 0 )
- NORM NORM
-
- 2 2
- where NORM= square root[(-(y1-y2)) + (x1-x2) + 0]
-
-
- Z
- ^
- |
- ______________
- |\ 1| \
- (x1,y1,1)_____________\(x2,y2,1)
- | | | <-- | |
- | || | L2 | |
- | |v | | |
- | |L1 | | |
- | | | | |
- |_|____|_____| |
- \ | 0|_ _ _ \_|_ _ _ Y
- \|___/________\|
- (x1,y1,0)/ (x2,y2,0)
- /
- /
- X
-
-
- The problem is that we couldn't get correct illumination
- when displaying in draw-solid and draw-lighted, they are just
- reversed (lighted sides to be dark and dark becoming lighted)!
-
- The normal system of the original code seems using
-
- --> x1-x2 -(y1-y2)
- n = ( --------, --------, 0 )
- NORM NORM
-
- but it can't make any sense why they calculated in that way!
- and we have tried all possibilities of the normal system
- (including their way!), unfortunately, none of them works!
- We began to doubt there might be something wrong in the normal
- system of the original programs and they were fixed in somewhere
- else?
-
- Could anyone help us to figure out what wrong it is? Or
- any suggestion? Thank you in advance.
-
- Charlie Qu
- FACTT Center
- Univ of Texas at San Antonio
- E-mail: charlie@nacho.cr.utsa.edu
-