vertex position question

Blitz3D Forums/Blitz3D Programming/vertex position question

Hey peeps..

Im looking to transform a mesh's vertexX, Y and Z positions to global positions. Can this be done, if so, how?

Ive got a neato little function thats playing up from my kludges so im going to restart it, but this is the key to it working right this time....

Something like this should work - not tested ....


For s = 1 To CountSurfaces( mesh )
For v = 0 To CountVertices( s ) - 1
TFormPoint VertexX(s,v), VertexY(s,v), VertexZ(s,v), Mesh, 0
x# = TFormedX()
y# = TFormedY()
z# = TFormedZ()
Next
Next

You'll have to scale it too, if the mesh isn't at 1,1,1 scale.

I don't think you do Anthony as the tform commands take this into consideration - I always found it a pain in the butt!!

One thing to remember... you can't get vertex positions that are transformed by animation, only the initial start positions. Just a note to remember if you didn't know already :)

Cheers guys.
@Stevie G
The tformvector function wouldnt do what i needed it.

@Sunteam
Im not animating the object.


I found a rather "kludgy" solution, using pivots. Thanks for your inputs anyway :D

TformPoint is what I suggested. Why would it not work - what is it you're doing that's different from your explanation above?

sorry! didnt read it properly!!! thats what i get for scanning.

Tformpoint.... ahh! see, what I was doing- was tformvector- and when i saw the tformxx and tformedx() commands, iassumed incorrectly,.


Thanks! Stevie G, i will go and try this when i get hold of the source... have to be later as my server seems to have died, yet again >.< hehe..

Cheers again!