xna 4.0 - Assistance needed to "snap" 3D model to 3D terrain mesh in XNA -


i'm trying restrict height of model height of mesh on it's moving. have been looking issue short while , seems there plenty of ways solve problem if used heightmap generate terrain, going , checking mesh's boundingsphere collision vertex data stored during mesh generation, idea of importing mesh .x file.

i've been trying wrap head around creating custom content processor save vertex data (edit:) of terrain tag on (edit:) terrain model, seems quite deal more complex have thought. i've gotten hold of triangle picking tutorial microsoft, , seems possible solution, there another, simpler way?

i'm trying move mesh no variation (a ball, instance) on potentially randomly generated mesh (terrain). ideas, or should suffer through learning curve imposed on me triangle picking example?

thanks.

the simple answer (which generate terrains) have model contains in bounding box, , let model's reference point middle of bottom of bounding box. when snap terrain, find z value @ desired x,y point, , set z value model's z value.

now cause terrain this:enter image description here

but that's okay. works snapping in cases, manually tweak if need in cases shows.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -