Like the title says,i'm struggling to convert the N attribute to orient attrtibute. Been watchinng an hour of Junichiro Horikawa's video on the topic... and i just feel dumber after it
Cheers,
A.
convert normal attribute to orient?
11251 3 1- Adriano
- Member
- 408 posts
- Joined: 6月 2015
- Offline
- tamte
- Member
- 8583 posts
- Joined: 7月 2007
- Online
N doesnt define full orientation, you need up vector also
you can provide it or just assume to be {0,1,0} to get the default houdini behavior as if not proided
you can provide it or just assume to be {0,1,0} to get the default houdini behavior as if not proided
vector nN = normalize(v@N); vector nup = normalize(v@up); p@orient = quaternion(maketransform(nN, nup));
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- Adriano
- Member
- 408 posts
- Joined: 6月 2015
- Offline
tamte
N doesnt define full orientation, you need up vector also
you can provide it or just assume to be {0,1,0} to get the default houdini behavior as if not proidedvector nN = normalize(v@N); vector nup = normalize(v@up); p@orient = quaternion(maketransform(nN, nup));
Thanks Tomas, Posted on facebook as well, and Johnathan de Blok was kind enough to remind me of Matt's docs... where the answer was waiting to be studied for years :$ Seems slightly different than your code, but it does the trick nevertheless. Any benefit using one or ther other?
//@N = {0,1,0};
//float s = sin(@Time);
//float c = cos(@Time);
@up = set(0,1,0);
@orient = quaternion(maketransform(@N, @up));
I had a polyframe above where i did set the up attribute, and normals were set as well already. That bit of code did the rest. SKipped the (0, 1, 0) though.
Cheers again,
A.
Edited by Adriano - 2021年9月16日 12:58:18
- Faitel
- Member
- 94 posts
- Joined: 7月 2019
- Offline
-
- Quick Links