This project has moved and is read-only. For the latest updates, please go here.

Is it possible to make geom from a .x or a .fbx?

Mar 6, 2009 at 1:57 AM
i want to make a 2d plataformer with 3d graphics. all the 3d physics engines ive found have poor documentation or no documentation at all (ok, they come with samples, but ive been programing for a short time and usually i get confused with big code not writen by me), so i decided to use the farseer engine.
there's no problem to make a player with a rectangle, but there is for the scenery. making manually a custom  geom would take a lot of time and probably the model wouldnt have exactaly the same shape of that geom. i could use that geom from image factory (rendering the models with a  orthographic camera) , but a simple model is smaller than an image. so, do someone know how can i use a model to make a custom geom (if its possible)?

by the way, i cant make the debug view work, could someone help me with that?
Mar 6, 2009 at 5:23 PM
Edited Apr 23, 2009 at 11:48 AM
we're currently working on a 2d platformer with 3d graphics too. for our collision shapes we define an extra 2d collision curve in 3ds max, export them and build PolygonGeom with those vertices. with 3d meshes you have the problem to consider which vertices belong to the 2d shape. you could iterate over your vertices and only take these which are on z=0 (or within a certain range), but then you have to make sure you really have vertices on z=0.

with the debug view, maybe you need to load the 2d camera for XNA.

see also:
Mar 6, 2009 at 7:05 PM
What yobiv said is doable as long as your 3D models are not animated. If they are animated you need to switch your geom every frame or manually create a geom that fits well over the duration of the animation.
Mar 9, 2009 at 4:53 PM
yobiv, i was thinking to do what you said, but how exactaly can i interate (or at least acess them) through the vertices (step by step) ?
Mar 9, 2009 at 10:24 PM
i'm not exactly our graphics programmer so i don't know how hard that is in XNA but maybe this article will help you: