PDA

View Full Version : vertex position?


Technofreak
04-07-2004, 10:04 PM
how do I query the position of my selected vertex?


Thank You

Bobo
04-07-2004, 10:50 PM
Originally posted by Technofreak
how do I query the position of my selected vertex?


Thank You

theObj = $Box01 --some object, must evaluate to editable mesh
if classof theObj == Editable_Mesh do
(
theSelection = (getVertSelection theObj) as array
--If there is at least one selected, get the first one:
if theSelection.count > 0 do
thePoint = getVert theObj theSelection[1]
)


Note that the position is in world coordinates.
To get the position in local space, you could use

in coordsys theObj thePoint = getVert theObj theSelection[1]

or

thePoint = (getVert theObj theSelection[1])* inverse theObj.transform


If the object is not an editable mesh, it is not very probable it will have any selection, but you could still access the .mesh property to get the mesh from the top of the modifier stack evaluation.

Hope this helps.

(I know, still da man)

Bobo

Technofreak
04-07-2004, 11:49 PM
:bowdown:

CGTalk Moderation
01-18-2006, 12:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.