Archived

This topic is now archived and is closed to further replies.

Running_Wolf

Model Loading - using BSP's(I think)

Recommended Posts

Running_Wolf    122
Okay, my problem is that I am trying to load the trueSpace object files and use them in my program. I have a resource of how the trueSpace files work. I need a way to, using input from the files, create custom lists of things. For example: In a trueSpace object file it gives the number of vertices in the object and then those co-ordinates for each one. Then later when they give the faces. They say how many faces there are and give the vertex information for each face using the vertex list. Did that make any sense? So I need a custom array of points and planes or whatever. I think that I could use linked lists. Am I facing the right direction? Also, somewhere I read that a standard way for using complex models is a BSP tree. Where can I find information on this so that I can create a class and appropriate functions so that I can load a trueSpace file and use all the animation information and stuff. Am I making any sense? Sorry if it is confusing.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
You''ll typically wanna use a space partitioning algorithm such as a BSP or an octree to, well, partition your static meshes (i.e. your world, moving entities like doors or platforms excepted) and perform view frustum culling, line of sight computation and/or collision detection on this level data. Is it what you mean when you talk about "complex models"?

Concerning smaller models such as characters, you can simply use bounding sphere/box computations against the view frustum to check if the model is potentially visible, but you really can''t apply BSP partitioning to such meshes. Let OpenGL take care of the clipping and back face culling and render all your model''s faces each time you detect it as potentially visible. Include all static meshes in your BSP computation and process moving entities separately at rendering time. That''s what I''m doing with my world data loaded from a 3ds file and BSP-partitioned, and my characters (I''m using md2 files) managed separately.

Check out mr-gamemaker.com from time to time, the BSP series might become available again in the near future. Also you can take a look at Graphics Gems vol.V, "A walk through BSP trees" by Norman Chin explains quite well the basics of BSPs. Check out Dan Royer''s BSP tutorials too...

HTH

Share this post


Link to post
Share on other sites
Running_Wolf    122
I''m talking about my individual characters. Is there a standard method of how the character data is stored in the program. After being loaded. As I said in my last post, I need a way to have custom amounts of points and face information. Right now I have structs for each. How do I set aside a custom amount of each of them for my characters data?

Share this post


Link to post
Share on other sites
Running_Wolf    122
Can''t anybody help me? I need some ideas on how to store incoming character data with animations in memory. Such as how many vertices there are and the location of each one of them. And then how many faces the model has and which vertex goes where.

Share this post


Link to post
Share on other sites
ZubZorro    122
take a look at the milkshape tutorial at nehe, it has some structs that you can use for storing objects..
it even has the structs for milkshape itself for you to look at

Share this post


Link to post
Share on other sites
Elixer    122
Start out with whatever works. Then you can optimize it.

For example, on the first pass of reading the data file, count how many triangles/quads/whatever you need. Then you allocate that amount of memory, then you rewind the file, and plug the actual data into your structure.

You can use a link list, or you can use dynamic arrays, or whatever else. It doesn''t really make that big of difference.

Share this post


Link to post
Share on other sites