rotate point normals around tangents in vex

   9080   4   2
User Avatar
Member
30 posts
Joined: 3月 2006
Offline
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)

User Avatar
Member
495 posts
Joined: 7月 2005
Offline
Hi,

you can use primuv to evaluate “tangentu” from first input.

Attachments:
twirlsetup3X.hipnc (66.8 KB)

User Avatar
Member
339 posts
Joined: 12月 2014
Offline
Here's another way, using edge_dir attribute from a point SOP

Attachments:
twirlsetup4.hip (77.5 KB)

User Avatar
Member
30 posts
Joined: 3月 2006
Offline
@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;
User Avatar
Member
6 posts
Joined: 2月 2019
Offline
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,
  • Quick Links