vertex position question

Blitz3D Forums/Blitz3D Programming/vertex position question

Damien Sturdy(Posted 2004) [#1]
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....


Stevie G(Posted 2004) [#2]
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


AntonyWells(Posted 2004) [#3]
You'll have to scale it too, if the mesh isn't at 1,1,1 scale.


Stevie G(Posted 2004) [#4]
I don't think you do Anthony as the tform commands take this into consideration - I always found it a pain in the butt!!


Sunteam Software(Posted 2004) [#5]
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 :)


Damien Sturdy(Posted 2004) [#6]
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


Stevie G(Posted 2004) [#7]
TformPoint is what I suggested. Why would it not work - what is it you're doing that's different from your explanation above?


Damien Sturdy(Posted 2004) [#8]
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!