|
||
|
GP Mailing List
ATXGPSIG List
|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [gameprogrammer] Re: collision detection
On Mon, 2004-06-21 at 10:40, Roger D. Vargas wrote: > I want to make some simple tests with terrain rendering in opengl and I > would like to know where i can find some tutorial about basic collision > detection. I want to achive 2 things: first convert mouse click > coordinates to terrain coordinates Typically that is done through "picking". You have to provide names for your opengl primitives and you do a sort of "fake" redraw to let the hardware find named primitives within a certain distance of the cursor. Then you cull all that mess to find the ones you want. Try googling on the phrase "opengl picking". There are some good tutorials right at the top of the search page. > and second: correct object movement > throug the map (going up and down in the hills and stop at walls) Lots of ways to do that. Generally either a height map is used or a BSP tree is used. If you know where you are you can look up the height in a height map. Just interpolate between height map entries to find the correct height. If you need perfect height, then use a BSP tree to identify the primitive you are in and then interpolate to find the height of your current location. Of course, if your terrain is stored as a height map, then the first technique is the easiest and gives you perfect height information. Bob Pendleton -- +--------------------------------------+ + Bob Pendleton: writer and programmer + + email: Bob@Pendleton.com + + blog: www.Stonewolf.net + + web: www.GameProgrammer.com + +--------------------------------------+ --------------------- To unsubscribe go to http://gameprogrammer.com/mailinglist.html
|
|