Model Loading - using BSP's(I think)

Started by
5 comments, last by Running_Wolf 23 years, 2 months ago
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.
L.I.G. == Life Is Good
Advertisement
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
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?
L.I.G. == Life Is Good
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.
L.I.G. == Life Is Good
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
Jonas Meyer Rasmussenmeyer@diku.dk
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.

What are dynamic arrays? Do they have an advantage over linked lists?
L.I.G. == Life Is Good

This topic is closed to new replies.

Advertisement