Path: chuka.playstation.co.uk!news From: "Mario Wynands" Newsgroups: scee.yaroze.programming.3d_graphics Subject: Re: race track Date: Sat, 25 Apr 1998 21:38:15 +1200 Organization: Sidhe Interactive Lines: 34 Message-ID: <6hsa2n$b010@chuka.playstation.co.uk> References: <01bd701f$d56f9a40$77e16dc0@ulthar.han.de> NNTP-Posting-Host: p27-max6.well.ihug.co.nz X-Newsreader: Microsoft Outlook Express 4.72.2106.4 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 Roland Boettcher wrote in message <01bd701f$d56f9a40$77e16dc0@ulthar.han.de>... >From a previous posting (from SCEE I think) I remember that the best >thing to make a race track is to split it up into sections. You then >display only the section your car is located onto and some sections up >to a distance. Here comes my problem: How do I compute the section >I am currently located onto? All I have is the position of my car and >the positions of the other sections. You could divide your world up into a 2D grid represented by a 2D array. For each grid square work out the section that takes up the majority of the square and store the section identifier (an integer index or pointer depending on how you have set up your sections). Then just use the poistion of the car to index into the array. Should be pretty easy to implement and relatively fast. To work out which other sections to draw you could setup a "section visible list" for each section which lists what other sections can be seen from that one (am I still making sense ?). That way you can use the grid mentioned above to work out the primary section, and then step through the section visible list to display all other relevant sections. Again not too hard to set up (can be done in a 2D array of booleans if you don't have too many sections) and should be pretty fast. Mario Wynands Director/Project Manager, Sidhe Interactive Sony Playstation Software Development House Email mario@sidhe.co.nz Website www.sidhe.c.nz