Page 1 of 1

Multiple Textures on a TriangleMesh

Posted: Mon Aug 23, 2010 10:42 pm
by RyanGadz
everytime i try to import my fbx model with more than one texture as a TriangleMesh i get an error. can this even do multiple textures?

i am thinking about importing 2 models, one to do the physics and one to draw because i'll have a lot of transparent textures in my game. Does this make any sense?

Re: Multiple Textures on a TriangleMesh

Posted: Mon Aug 23, 2010 10:48 pm
by Norbo
The BEPUphysicsDrawer is just a demos/debugging drawer. You can technically draw arbitrary models using parts of it, and its source is available in the demos. However, if you need an actual rendering solution, I strongly recommend that you do not use the BEPUphysicsDrawer. It's built for drawing physics engine data, and trying to extend it for a game will only cause pain down the road.

I also wouldn't recommend creating any sort of BEPUphysics TriangleMesh unless they are actually going to be used in a simulation, since it's a heavy object with acceleration structures computed inside.

Re: Multiple Textures on a TriangleMesh

Posted: Mon Aug 23, 2010 10:50 pm
by RyanGadz
Norbo wrote:The BEPUphysicsDrawer is just a demos/debugging drawer.
i just read this in another one of your posts as well. it makes sense now thanks!

do you know of an easy way off hand to disable texture data when making the trianglemesh? it would be nice so i dont have to load basically the same object twice. this game is already getting larger than i want it to be.

Re: Multiple Textures on a TriangleMesh

Posted: Mon Aug 23, 2010 10:58 pm
by Norbo
The BEPUphysics TriangleMesh doesn't know about texture data; all that it wants is a vertex and index buffer. The specific way you get those vertices and indices depends on how you set things up. You could store a vertex/index buffer from a custom content processor, or just load in the vertices from a Model at runtime using the StaticTriangleGroup/TriangleMesh.GetVerticesAndIndicesFromModel method.