PDA

View Full Version : how to get the u or v vector of a given polygonal vertex?


Amadou
08-19-2003, 05:06 AM
Is there a mel or node that i can use in the particle runtime expression to sample the u or v direction vector of the given vertex of a polygonal geometry ?
I 've found the mel to sample the normal vector of the given vertex of a polygonal geometry. It's called polyNormalPerVertex. I can gain the normal vector if i write "polyNormalPerVertex -q -x -y -z pCube.vtx[3]" into the script editor . But ,how to get the u direction vector ?
Please help me .thanks a lot .
Should i use the api to get the point ?

galactor
08-19-2003, 06:55 PM
I don't think it is possible for polygon geometry.
It is possible when working with Nurbs geometry!

:: Galactor ::

wrend
08-19-2003, 07:22 PM
yeah, i imagine its undefined for a polygon? if you knew your faces were going to be square i guess you might build a single nurbs patch on it and grab the tangent off it....but how do you decide which way is U, V? what are you tring to do? might the plane perpendicular to the normal be enough?

dunkel3d
08-20-2003, 03:35 AM
Could you use adjacent verteces and some trig to, if not figure out, create your own "UV" values?

S

playmesumch00ns
08-20-2003, 09:22 AM
You can't directly grab the u or v direction vectors from polygonal geometry in Maya. Mainly because such things don't actually exist. In RenderMan this is easy...

Unless I'm being incredibly short-sighted, the only way to do this is per-vertex. You have to project each vertex's one-neighbourhood (all the vertices that are attached by only one edge) into the tangent plane of the vertex in question (P).

Since you know the uv coordinates of these points now in tangent space, you have a series of samples to which you can fit a curve. The u vector (|dP/du|) will be the unit vector in the direction where deltav = 0, conversely, the v direction vector (|dP/dv|) will be the unit vector in the direction where deltau = 0.

Or something like that. Basically it's a nasty, nasty problem.

playmesumch00ns
08-21-2003, 09:30 AM
It would probably suffice to do a linear interpolation.

basically, find which consecutive pair of vertices as you go "round" your centre vertex have a positive and negative change in u, respectively. Your v direction vector will lie somewhere in between these vertices.

You don't have to do the projection to tangent space either, since the uv coordinates already give you that.

Amadou
08-21-2003, 11:20 AM
thank you galactor,wrend , dunkel3d and playmesumch00ns .

I find that if you turn on the check box in the move tool option window and select a polygonal vertex , you will find the u and v directions are displayed as the manipulator of the move tool .
So i want to use them in my particle expression to control the instanced object to aim to the u or v direction .

(sorry ,my english is poor ,there are so many "to" in my sentences.)

I am still confused now.

CGTalk Moderation
01-15-2006, 10:00 PM
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.