Vertex positions

Blitz3D Forums/Blitz3D Programming/Vertex positions

Ross C(Posted 2006) [#1]
If i read the vertex co-ords via vertexX,y and z, i know the co-ords are taken from the entities centre. But, if i rotate that entity, does the co-ords get trasformed as well?

What i'm trying to do, is get the lowest point on a mesh, by reading the lowest vertexY() position.


Beaker(Posted 2006) [#2]
Use TFormPoint() on each vertex position to find out its true position in the world.


Ross C(Posted 2006) [#3]
I have tried tformpoint using the vertex co-ords of the mesh, source being the mesh and destination being the world, but rotateentity doesn't change the vertex co-ords at all, so how would i find their positions?


Ross C(Posted 2006) [#4]
	TFormPoint 0,VertexY(surf,0),0,mesh,0
	Text 0,0," y = "+TFormedY()



Ross C(Posted 2006) [#5]
I guess i'll need to use rotatemesh instead then? That's a bummer...


Ross C(Posted 2006) [#6]
I suppose... if i kept track of the entitys rotations, performed via RotateEntity, i could always rotate the mesh that amount, grab the co-ords, then rotate the mesh back by the same amount. Just wondering if there is an easier way...


Stevie G(Posted 2006) [#7]
It should work fine with rotateentity. You need to use all the vertex coords to get the correct tformedy()

tformpoint vertexx( s, v ) , vertexy( s, v ) , vertexz( s, v ), mesh , 0

text 0,0, " y = " + tformedy()


p.s. What you making?


Ross C(Posted 2006) [#8]
AH! Thanks Stevie and Beaker. Odd that i would need all co-ords, since i'm only rotating on the X axis :o)


Ross C(Posted 2006) [#9]
Thanks for the quick responces, much appreciated!