Working with .x files

Started by
4 comments, last by Stowelly 18 years, 6 months ago
Hi all, I am trying to simulate a driving car scene (like Need For Speed game). I am thinking to use .x file to create the whole scene and load it into my program. How can I render only some parts of the .x file? Or is there any better way? Thanks a lot in advance.
Advertisement
Hi there aye2m,
How are you doing?

The Problem
Rendering parts of a .x mesh

The Solution
You can start looking at how PVS (Potentially visible set) is implemented. It's a method that basically just checks which regions of your map is visible and how they have implemented a BSP (Binary Space Partition).

These are all methods that Doom/Quake have implemented. I haven't really done this with .x files and i'm sure it can be done or you could create your own file format.

Look at this article at flipcode. They basically go over how the Quake 2 map file format works and looks.

With a direct approach to your question. It's going to be difficult if you aren't dividing your .x files up into little segments. The approach I would do might be simple but effective is to essentially break your map into smaller .x files. Maybe a .x mesh for every room and use the BSP to couple them together similar to the Quake map format. This way you can cull big parts of your map from being rendered using frustum culling.

I hope this helps buddy.
Take care.
Thanks a lot for your help.
A mesh can contain multitple meshes, and each mesh can contain segments. using directx, you can access any particular part of a mesh, but I dont belive its the standard way to go about creating a scene. My guess is that you're building a scene in maya or max and you want to export the whole thing to an x file?
Quote:Original post by Stellar Developer
My guess is that you're building a scene in maya or max and you want to export the whole thing to an x file?


Yeah. I want to create the whole scene and load it into my program. Is using an x file for the whole scene a good way? The idea is to simulate the driving car like NFS.

Thanks a lot.

i found this link really helpfull to get me loading animated meshes exported to x files

http://www.toymaker.info/Games/html/load_x_hierarchy.html
http://stowelly.co.uk/

This topic is closed to new replies.

Advertisement