Getting face normal using UV?
Hi,
How do you get the face normal fi you have the UV.
Lets say for a polygon you have U = .2 and V = .5.
how do you get the normal of that face at that UV.

Thanks you.

thematt

05-10-2011, 08:43 PM

you could plug a follicle at the exact uv and get its orientation, or get its position and extract the normal with a closestPointOnMesh or pointOnMeshInfo don't remember whitch of the 2 one can extract normal or a normal constraint maybe of a locator at that point may return soemthing usefull...

this should get you going, there is probably even a command polyInfo maybe that can return exactly that at uv cord but not sure and I don't have maya here to test sorry.

cheers

Aikiman

05-10-2011, 09:06 PM

What do you want to do with the UV?

FluidEdge

05-11-2011, 08:23 PM

Is this even possible? What relation do uvs have to a mesh? A single uv doesn't need to have a unique point on a mesh (overlapping uvs for example) - so if a uv represents 2 or more points on a mesh which does it return?

A point on a mesh can give you a uv coordinate but the reverse is not really possible I don't think.

Need more info on what you're trying to do!

thematt

05-12-2011, 09:56 AM

seriously try with the follicles once plug give them the uv you need, and query the outNormal from the follicleShape, fast and easy. Of course as it's been mention above no overlapping Uv or it wouldn't work.

cheers

Xsiv

05-12-2011, 04:08 PM

Funny thing - yesterday I was attempting to do the same thing with particles. They collide with a body - gore/blood/dirt - and it (the particles' instances) stick to the surface upon collision.

The issue I have is that the particles are floating above the surface - I have the collision tolerances very small - 0.01 - however, there seems to be an issue with nParticles. I am using the radiusPP ramp to size the instances - and it uses the largest radiusPP value as the distance off the surface that the particles sit.

So, thinking I could use a goalOffset, I need to bring the particles closer to the surface. However, I couldn't get the normal at the point of collision. nParticles even have goalWorldNormal0PP when you add goals - to cause the sticking part. Again, thinking I can make use of this, but unsure of how?

goalOffset = -0.5*normal (at point of collision)

normal... would be calculated? Be aquired by? read in through? Mind blank....

I'd like to know?

Chris

Xsiv

05-12-2011, 05:45 PM

Hahaha! I don't know if this will help you or not, but I solved my problem - MAYA's wonderful feature - the MEL version of the command does not work - and so I tried it in python and guess what? It works!

Follow Us On:

The CGSociety

The CGSociety is the most respected and accessible global organization for creative digital artists. The CGS supports artists at every level by offering a range of services to connect, inform, educate and promote digital artists worldwide. More about us