rifter1818 Posted March 13, 2004 Posted March 13, 2004 Is there any way to get the hieght of a mesh at a certain point? Let me give you what this is in refrence too, The battle Scene of my rpg takes place on a 9x9 grid of 150x150 blocks the whole grid is one big mesh, What i want to do is find out how high the mesh is on one of these blocks, currently the only way ive thought of so far is to have my Modeler enter the heights (or altitudes) into a textfile, then have the game input them (allong with other grid specific info). Just wondering if any of you know a better way of assertaining this information. Thank you all for the extravagent amount of help you have given me. Quote
RobyDx Posted March 13, 2004 Posted March 13, 2004 Is there any way to get the hieght of a mesh at a certain point? Let me give you what this is in refrence too, The battle Scene of my rpg takes place on a 9x9 grid of 150x150 blocks the whole grid is one big mesh, What i want to do is find out how high the mesh is on one of these blocks, currently the only way ive thought of so far is to have my Modeler enter the heights (or altitudes) into a textfile, then have the game input them (allong with other grid specific info). Just wondering if any of you know a better way of assertaining this information. Thank you all for the extravagent amount of help you have given me. it's easy enaugh getVertex and index array costruct the entire triangle sequenze. test in what triangle the point to test is get the plane from the triangle use the equation to found it. you can find a sample on my website (it's in VB6 but obviosly work also in VB.Net, use it as reference) http://robydx.altervista.org/VarieLess12.htm if you need help tell me Quote Come to visit
Kavan Posted March 13, 2004 Posted March 13, 2004 It would be even easier to just use Mesh.Intersect. Quote
rifter1818 Posted March 14, 2004 Author Posted March 14, 2004 Could you include a Link to an example or an example? of How to use the mesh.intersect function? Thanks (Thanks for your help too Robydx) Quote
RobyDx Posted March 15, 2004 Posted March 15, 2004 of How to use the mesh.intersect function? Thanks (Thanks for your help too Robydx) simple use a vector position and a vector direction. You start position up the mesh and direct to down the ray. In the structure intersectInformation you 'll obtain the distanze from position and other information. If the mesh has a trasformation different from identity the you must trasform position by the inverse world matrix of the mesh. by the way if you create a mesh from your vertex and not from file this instruction don't work because need attribute table and 'll gave you an error in some case. It's also slow from a solid algorithm but it's work great if you use it in property way Quote Come to visit
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.