getting a local x,y,z coord of a vertex

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
Old 05 May 2003   #1
getting a local x,y,z coord of a vertex

I have two vertices. Is there a way to get the local (or global I guess) coordinates of these two vertices?

thanks for your time
Old 05 May 2003   #2

Turn on "Echo All Commands" in the Script Editor, and then select the vertices you want coordinates for. It will show you which vertices they are, and I am sure that from there, you can get their x, y and z coordinates.
Old 05 May 2003   #3
you can get the local position of one vertex in the mesh node of the poly

the local position is vrts[numvertex]+pnts[numvertex]

vrts is the original local position and pnts is the tweak of this vertex

the position in x of the vertex 293 is

Old 05 May 2003   #4
if I understand this correctly you basically move a vertex by 0 and it returns the result, which you capture and use?

Old 05 May 2003   #5
Post # construct ???

thank you for the replies. they have helped.

In the node reference, for subdiv surfaces, it says there is a node called "vertex", which is a compound type.(file://C:\Program%20Files\AliasWavefront\Maya4.5\docs\en_ US\html\Nodes\subdiv.html).

It also says that the array can be accessed using the # construct but gives no example of how to use it. My attempt to get the info gets nothing.

given subdivSphere1:
float $z[] = `getAttr subdivSphere1.vertex`
print ($z[0]); // " " <- no value

I am trying to get the vector coords of a subd point in space, which I can already do with poly vertices.

thank you for your time
Old 05 May 2003   #6
i strongly recommend using the command xform , which has switches to query world space coordinates from anything..


Old 05 May 2003   #7
can you even select "points" on a subdivision surface? since they are evaluated through polygonal proxies, you can't actually select a "point" on the surface unless the detail level is extremely high, I would imagine. am I way off on this...?
Old 05 May 2003   #8
For any points, use pointPosition -w/-l (point)... the result is an array of 3 float values [float float float]. for example:

I have a polygon sphere called pSphere1.

world coordinates :
pointPosition -w pSphere1.vtx[0];

local coordinates :
pointPosition -l pSphere1.vtx[0];

Still not sure how well that will work for subd surfaces though.

Last edited by TiKiMoN : 05 May 2003 at 09:41 PM.
Old 05 May 2003   #9
alex: thanks. Xform doesn't seem to work on vertices though. Select a sud vert and run "xform -q -r -os -m;" the values are the same for everything.

(man I feel like i'm working in the dark because no one knows much about subd. The documentation is hooorrrrible)

Given a subd sphere named "subdivSphere1":

setAttr "subdivSphere1.displayLevel" 1; // where 1 should be desired level
pickWalk -d down;
querySubdiv -a 4; // selects faces.
string $vertex_list[] = `subdListComponentConversion -ff -tv`;
// print string for vertices

All this being said, does anyone understand what the # means in the flag help documentation (file://C:\Program%20Files\AliasWavefront\Maya4.5\docs\en_ US\html\Nodes\flagHelp.html). I just need that damned coord of a subd vertex

again thanks
Old 05 May 2003   #10
not -os.. that is object space i think (no maya here)

ther is a -ws or something for world space..

i am about 102% sure.. roughly.. i counted twice


Old 05 May 2003   #11

OMFG tikimon, you are my hero

pointPosition -l subdivSphere1.smp[256][67108867];

works like charm now I can finish my poly uv transfer to subd script. Screw that weird # construct.


[edit - actually thanks goes to everyone who replied to this thread ]

Old 05 May 2003   #12
sweeeeeeeeeeeet. in an effort to make myself look less intelligent than it appeared before, I just browsed through the MEL documentation until I found that command. anyway, glad it works!
Old 01 January 2006   #13
Thread automatically closed

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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 06:16 PM.

Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.