rotate point normals around tangents in vex
10437
4
2
-
- pingo
- Member

- 30 posts
- Joined: 3月 2006
- オフライン
I know this has been asked before, but I simple can't get this to work correctly.
I got a curve with a lot of points. I put N and Tangentu on the points with a polyframe and in a Pointwrangle I have the following:
___
float twist = chf('twist');
vector tnorm = normalize(@tangentu);
matrix3 m = ident();
rotate(m, twist, tnorm);
@N *= m;
___
- twist is a float slider.
The Normals rotate, but on some weird axis. I obviously need them to rotate around Tangentu
Hip file attached
Attachments:
twirlsetup3.hip (71.8 KB)
-
- Aizatulin
- Member

- 504 posts
- Joined: 7月 2005
- オフライン
Hi,
you can use primuv to evaluate “tangentu” from first input.
Attachments:
twirlsetup3X.hipnc (66.8 KB)
-
- AndyW
- Member

- 343 posts
- Joined: 12月 2014
- オフライン
Here's another way, using edge_dir attribute from a point SOP
Attachments:
twirlsetup4.hip (77.5 KB)
-
- pingo
- Member

- 30 posts
- Joined: 3月 2006
- オフライン
@moogtastic, thanks!
It wasn't even the assignment of tangents that was off. It was the syntax in my vex.
This worked:
___________
float twist = chf('twist');
matrix m = ident();
rotate(m, twist, v@tangentu);
@N *= m;
-
- endframe
- Member

- 6 posts
- Joined: 2月 2019
- オフライン
Hi,
I know this is a very old post, however I was wondering, with current setup, how would you drive rotation by an attribute such as Cd, P...
Cheers,