home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / programm / 2087 < prev    next >
Encoding:
Internet Message Format  |  1992-07-23  |  2.0 KB

  1. Path: sparky!uunet!pmafire!news.dell.com!swrinde!sdd.hp.com!wupost!gumby!destroyer!ncar!noao!amethyst!organpipe.uug.arizona.edu!news
  2. From: dave@cs.arizona.edu (Dave Schaumann)
  3. Newsgroups: comp.programming
  4. Subject: Re: MAZE
  5. Message-ID: <1992Jul23.214526.24166@organpipe.uug.arizona.edu>
  6. Date: 23 Jul 92 21:45:26 GMT
  7. References: <1992Jul23.145751.29068@wuecl.wustl.edu>
  8. Sender: news@organpipe.uug.arizona.edu
  9. Reply-To: dave@cs.arizona.edu (Dave Schaumann)
  10. Organization: University of Arizona
  11. Lines: 35
  12. In-Reply-To: ppc1@cec2.wustl.edu (Peter Pui Tak Chiu)
  13.  
  14. In article <1992Jul23.145751.29068@wuecl.wustl.edu>, ppc1@cec2 (Peter Pui Tak Chiu) writes:
  15. >I am trying to write a 3D maze in which the player can move around as if
  16. >he/she is "inside" the maze.
  17. >
  18. >I wrote a version but it is extremely slow.  First I transform the 2D maze
  19. >into 3D coordinates.  Then for every move, I redraw the maze with appropriate
  20. >transformation, rotations and hidden surface eliminations...  and as you can
  21. >tell it takes a lot of TIME!!!
  22.  
  23. From the sound of it, you are processing a lot of information that is never
  24. displayed.  If you think about it, for a reasonable maze, most of it will be
  25. invisible to an internal viewer from any particular viewpoint.  Thus, the
  26. first thing you should do is figure out a quick way to eliminate any structure
  27. that can't possibly be in the view.
  28.  
  29. A simple algorithm might be:
  30.  
  31.   Draw the room/segment/whatever that the viewer is in.
  32.   Add any visible doorways/connections to the "door" list
  33.  
  34.   For each door in the door list
  35.     draw that room, and add its visible doors to the door list
  36.  
  37. You'll still have to calculate the transformation matrix, but I believe this
  38. algorithm will yield a significant savings over trying to transform &
  39. draw the whole maze.
  40.  
  41. >thank you so much in advance!
  42.  
  43. Hope this helps...
  44.  
  45. -- 
  46. You're traveling through another dimension -- a dimension not only of sight and
  47. sound but of mind. A journey into a wonderous land whose boundaries are that of
  48. imagination.  That's a signpost up ahead: your next stop: the Twilight Zone!
  49.