Extracting Mesh from entity.

dwardu

09-03-2011 13:30:16

Hello,
I am trying to extract the vertices from an entity in order to create a navigation mesh for my model. I have created a model using 3ds max and exported it to a *.mesh file, later i load this into an entity and add it to my scene. But i am not able to retreive the vertex data through the entity object. i am using ogremax to export my mesh.
Am i doing this wrong?

Thanks

ianhfar

09-03-2011 14:27:06

Have you tried using GetMeshInformation

check the WIKI for the following code GetMeshInformation
http://www.ogre3d.org/tikiwiki/Raycasting+to+the+polygon+level+-+Mogre

dwardu

09-03-2011 14:56:32

I was looking at that a few hours ago, but i thought raycasting was only used for making 2d games look 3d, but i will take a look a the getmeshinformation method. I will get back to you once i have tried this out.

ianhfar

09-03-2011 15:03:00

GetMeshInformation

returns Vector3[] vertices, this from what I undrstand is what you are looking for.

dwardu

11-03-2011 08:48:59

i noticed something when playing around with that method, the indices sometimes not divisible by 3 and they leave a remainder. now from what i understand in 3d every model has to be created using triangles which undoubtedly has 3 sides.

Then what i did was look at the for loops and i noticed that they use the ++i iteration type not i++, when i changed them to i++ it worked just fine, could you confirm if this is a bug in the provided code or not? :)