• 0

C# (XNA) : 3D terrain and movement


Question

Basically I'm a beginner to 3D in C# and I was wondering if anyone knew any decent tutorials about collision with terrain and a model.

If someone wants to take the time to explain how the collision could work that'd be awesome - I'm not sure whether to import a 3D model of the terrain or create it using a height map - will the way collision is detected change depending on which method I chose?

Appreciate the help, hope someone can point me in the right direction.

Link to comment
https://www.neowin.net/forum/topic/888132-c-xna-3d-terrain-and-movement/
Share on other sites

5 answers to this question

Recommended Posts

  • 0
  On 30/03/2010 at 20:26, Haegr said:
If someone wants to take the time to explain how the collision could work that'd be awesome - I'm not sure whether to import a 3D model of the terrain or create it using a height map - will the way collision is detected change depending on which method I chose?
There's no reason you need to have different code for collision detection.

Basically terrain collision works like any other collision in 3D, you want to approximate your models (characters) using bounding boxes, spheres, etc., and check if they intersect with the terrain: only you can't approximate the terrain with bounding volumes (AFAIK), you test against each vertice in a certain radius around the character.

Of course there's no preventing you from coming up with more custom/optimized solutions, that's all the fun of game programming. I can imagine a system where you would average the terrain height around the character and place him a certain height above that average terrain height; he might interesect with some vertices, but it's probably faster.

See http://www.riemers.net/eng/Tutorials/XNA/Csharp/series1.php for terrain generation using a height map.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • PeaZip 10.5.0 by Razvan Serea PeaZip is an open source file and archive manager. It's freeware and free of charge for any use. PeaZip can extract most of archive formats both from Windows and Unix worlds, ranging from mainstream 7Z, RAR, TAR and ZIP to experimental ones like PAQ/LPAQ family, currently the most powerful compressor available. Open and extract 200+ archive formats: 001, 7Z, ACE(*), ARC, ARJ, BZ2, CAB, DMG, GZ, ISO, LHA, PAQ, PEA, RAR, TAR, UDF, WIM, XZ, ZIP ZIPX - view full list of supported archive file formats for archiving and for extraction. PeaZip provides fast, high compression ratio multi-format archiving - view file compression and decompression benchmarks for more information. PeaZip is localized in 29 languages and is capable of handling all most popular archive formats (180+ file types), supporting a wide array of advanced file and archive management features (search, bookmarks, thumbnail viewer, find duplicate files and compute hash/checksum value, convert archive files...), especially focused on security (strong encryption, two factor authentication, encrypted password manager, secure file deletion...). PeaZip 10.5.0 release notes: PeaZip 10.5.0 brings a major update in the file manager, boosting archive browsing performances, improving archive editing, adding new functions to open file as archive from within archives, to prevent running a custom list of file extensions without confirmation, and to hide or show hidden files. On macOS all file browser styles and icon sizes are now available as on other platforms. On Windows it is now possible to explore NTFS Alternate Data Streams to gather additional information on files, including a dedicated tools to batch scan the input for Zone.Identifier (Mark of The Web) to detect files coming from remote systems. In addition, the option to include the Zone.Identifier metadata in archives is now enabled by default for all formats supporting it (RAR, WIM). Backend were updated to Pea 1.25. Full list of changes and fixes is available at https://peazip.github.io/changelog.html Download: PeaZip 64-bit | PeaZip Portable 64-bit | ~13.0 MB (Open Source) Download: PeaZip 32-bit | PeaZip Portable 32-bit View: PeaZip Home Page | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • I’m still waiting for “small taskbar icons” don’t need a huge ass task bar. Been using explorer patcher for years simply for this functionality. Cmon ms, not everyone uses touch screens.
    • Pretty much right away and discovered the Start Menu changes, I wonder what would of happened if they did not rebrand the Windows 10 Sun Valley update into Windows 11. Kept it as a rolling release for Windows 10 with the major UI changes. Would it have faced as much scrutiny being just another Windows 10 feature update? I really cannot tell the difference between the two in my daily usage as my workplace has Windows 10 and I have the UI setup as I have previously done before so I literally notice nothing different or jarring.
    • Still waiting for ability to move taskbar to other three sides of my monitor.
  • Recent Achievements

    • One Month Later
      jezzzy earned a badge
      One Month Later
    • First Post
      CSpera earned a badge
      First Post
    • One Month Later
      MIR JOHNNY BLAZE earned a badge
      One Month Later
    • Apprentice
      Wireless wookie went up a rank
      Apprentice
    • Week One Done
      bukro earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      624
    2. 2
      ATLien_0
      280
    3. 3
      +FloatingFatMan
      178
    4. 4
      Michael Scrip
      149
    5. 5
      Steven P.
      118
  • Tell a friend

    Love Neowin? Tell a friend!