Mixing Graphic Model and Physic Model

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Kayl
Posts: 14
Joined: Wed Jun 08, 2005 7:17 am

Mixing Graphic Model and Physic Model

Post by Kayl »

Hi everyone,

I'am trying to do something clean to have a physical object.
It has a graphic part, ok : a 3ds file for example.
It has a physic part (I use ODE). A cube, 3 cubes, 1 cylinder and a cube for example.

I have seen a demo : http://www.glplanet3d.newmail.ru/OpenDE/ode_demo.html
In which the 2 are mixed in the 3ds file.

Because it is easy when creating the model to put cubes (here on the car) where it has to be, to rotate in, etc...

The demo use the basic meshes for the graphic part, and the meshes with a name like box (i haven't seen the code but using names it could be a way to distinguish physic from graphic) for the physic (also for graphic when option in game is used).

Unfortunately the information we have on a 3DS Mesh loaded by Irricht is poor. We loose the names.

So my question is :
How do you think we could easily mix graphic and physic in the same 'graphic' file to make it easy to build an object in a 3D Editor ?
Kayl
Posts: 14
Joined: Wed Jun 08, 2005 7:17 am

Post by Kayl »

Many readers but no writter. :cry:

I thought that kind of problem was already solved because it is something that appears essential to me in a video game developpement.
We have many 3D world editor for the graphic but I'm looking for a format that could mix graphic and physic because we don't always use the graphic meshes for the physic or the too simple global bounding box.

Anyone ? :)
Phenix
Posts: 51
Joined: Sat Nov 15, 2003 3:15 pm
Location: Earth
Contact:

Post by Phenix »

I haven't got a good answer for your question, but to identify a mesh buffer usually I use texture dimension: for example, you can assign to the physical part of your mesh always a 4x2 texture, and write down a function that get the complete mesh as parameter, and that split it in the graphical mesh and physical mesh.
This method has got the little advantage that you can load your meshes in any format you want.
But the faster way is to separate the two meshes in two different files, just model everything in one scene and export separately.
Kayl
Posts: 14
Joined: Wed Jun 08, 2005 7:17 am

Post by Kayl »

OK I think I could manage exporting in 2 different files but what about the shape : with names I could have known if an object has to be created as a cylinder, a box, a sphere in ODE.
Phenix
Posts: 51
Joined: Sat Nov 15, 2003 3:15 pm
Location: Earth
Contact:

Post by Phenix »

I don't know, you can still use texture dimensions to identify them, (ex. 2x2 for sphere 2x4 for cube 2x8 for cylinder), maybe it is the only way to do it? If not, I hope someone will correct me.
Post Reply