I'm rendering hair attached to some poly surface.
Use the following to get hair tangent direction:
vector Tangent = normalize(dPdt/Dv(t));
But using dPdt/Dv(t) or just dPdt seems to produce different results depending on point of view.
I.e if I rotate the camera around hairs then I get some other results for my tangents.
But hair tangent direction in world coordinates should not depend on camera position.
How can one get camera independent hair tangent?
Camera independent hair tangent
3297 3 1- sergey_sh
- Member
- 22 posts
- Joined: June 2008
- Offline
- symek
- Member
- 1390 posts
- Joined: July 2005
- Offline
sergey_sh
I'm rendering hair attached to some poly surface.
Use the following to get hair tangent direction:
vector Tangent = normalize(dPdt/Dv(t));
But using dPdt/Dv(t) or just dPdt seems to produce different results depending on point of view.
I.e if I rotate the camera around hairs then I get some other results for my tangents.
But hair tangent direction in world coordinates should not depend on camera position.
How can one get camera independent hair tangent?
Isn't dPdt in camera space, which is a current space for most surface context variables?
- Mario Marengo
- Member
- 941 posts
- Joined: July 2005
- Offline
SYmek
Isn't dPdt in camera space, which is a current space for most surface context variables?
Yes. So perhaps you're looking for the *transform(to_space,vector) [sidefx.com] family of functions to transform the “current space” (which in Mantra this is the same as “camera space”) tangent vector to “world space” (which corresponds to /obj).
So, maybe something like:
vector Tangent = normalize(vtransform(“space:world”,dPdt/Dv(t));
Cheers.
- sergey_sh
- Member
- 22 posts
- Joined: June 2008
- Offline
-
- Quick Links