Jump to content
  • Advertisement

Archived

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

bzroom

Own Model Format, how to render?

This topic is 5432 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m making my own model format for this game im working on where the limbs of the characters can be chopped off. I pritty much have how im going to render it. Each member of the body is a geometry class and after the matrix is all setup for it I call its draw method. I havn''t actualy tested this yet but I have a feeling since the verticies are assigned to each member that when one is severed there will be stretched polygons between the severed members, not to mention the holes left if this dosn''t happen. So what im asking is do you think it would be more efficient if I would create a display list for each member, and have each member capped. Or double up the verticies at the joints of the members and render them in the normal GL_TRIANGLES way I was planning? One problem I think I would face with display lists is that eventualy I want the members to accept blood splatters. Since the members geometry are shared by all instances of the same character, I dont think I could change the textures and coordinates per instance. I hope all that made sense and thanks ahead of time for help.

Share this post


Link to post
Share on other sites
Advertisement
All I can say is, sounds like my kind of game!

And I''m gonna go with...it depends on the rest of your design. If the geometry is pretty static, it may be good to go with display lists (or even better, VBOs)


Brian J

Share this post


Link to post
Share on other sites
Yea it should be pritty cool. Um, whats a VBO? and Will a display list ever become slower then not if there are two few verticies drawn in it?

Share this post


Link to post
Share on other sites
A VBO is a vertex buffer object. It''s a good way to store your vertex data in hardware. But this is where I can''t help you anymore, because I''m a D3D man myself . I just know a decent amount about OpenGL and the ARB. I''m sure you will find tons of information on google or on this site. Good luck


Brian J

Share this post


Link to post
Share on other sites
So its a vertex buffer like in D3d. I used to mess with that, could never get my frame rate above 10 or so. That was before my knowledge of the matrix. I would, everyframe, manualy update every verticies new position and resave it in a buffer. I guess thats not the fastest thing in the world.

Share this post


Link to post
Share on other sites
I would do something like this:

1) keep entire mesh in a vertex buffer
2) build a triangle list for each piece, and a capping list for each possible slice position, in system memory
3) build the actual triangle list/buffer by just concatenating triangle lists for pieces that are still connected; cap by concatenating capping lists for things that are severed
4) render the entire mesh using a single call (perhaps two calls, if you use a separate severed texture for the caps)

Note that you only need to re-build the list when the pieces get severed; you don''t need to do it per frame. Note that you can start out with a single mesh instance, and if you chop off an arm, you might spawn a separate "dummy" mesh for the arm piece flying away; the original and arm meshes can still refer to the same vertex buffer, but be rendered using different triangle lists as different calls.

Share this post


Link to post
Share on other sites
I guess i dont know as much about opengl as i thought i did. If i have all my characters mesh in a single triangle list. And render it with one call. How would i apply the transformations of each joint?

Share this post


Link to post
Share on other sites
The way I do characters, and I think this is pretty standard, is to have a hierarchical structure of (invisible) bone objects and animate those.

The character is single mesh, with skin information. Each vertex is driven by one or more bones, and each vertex/bone pair has a weight and offset vector; the offset vector is the vertex's position in the bone's coordinate system. When the driving bones are moved, the offset vectors are transformed by the corresponding driving bones absolute transformation matrices, and the final vertex positions are the weighted average of all the transformed offset vectors for each bone driving that vertex.

A simpler way to do this is to have one bone driving each vertex.

[edit: and just to clarify, to transform the vertices, I obviously don't use gl matrix commands, since I'm rendering the model in a single vertex array. I do the transforms manually using my own matrix class.]

[edited by - benjamin bunny on November 6, 2003 11:26:18 AM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!