Another Mesh Question

rifter1818

Junior Contributor
Joined
Sep 11, 2003
Messages
255
Location
A cold dark place
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.
 
rifter1818 said:
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
 
rifter1818 said:
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
 
Back
Top