Aligning one vector to another

Discussion of Genome, the extensible geometry modifier for 3ds Max
pfunkifized
Posts: 20
Joined: Sat Feb 08, 2014 1:31 pm

Aligning one vector to another

Postby pfunkifized » Wed Apr 04, 2018 6:54 pm

I'm trying to align the normal direction to another direction vector and am having some difficulty getting it to work in Genome.

Here is where I'm at:
- I get the acos of the Dot product between the two vectors to get the angle
- I get the cross product and normalize it for the axis
- Then I convert this to quat using AngleAxisToQuat

So how do I actually "rotate" the Normal direction using this? I see a TransformByQuat node but I don't think I'm using it correctly.

User avatar
Bobo
Posts: 6085
Joined: Tue Nov 15, 2005 10:26 am
Location: Vancouver, Canada
Contact:

Re: Aligning one vector to another

Postby Bobo » Thu Apr 05, 2018 2:29 pm

I am confused. Why do you have to rotate a normal vector to another verctor? Wouldn't it be enough to just grab the other vector, normalize it, and output as the value you want? A normal has a known lenght of 1.0, and you want the known direction of the other vector anyway. Unless you want to align gradually over time, of course...
Borislav "Bobo" Petrov
Product Specialist
Thinkbox Software Inc.

pfunkifized
Posts: 20
Joined: Sat Feb 08, 2014 1:31 pm

Re: Aligning one vector to another

Postby pfunkifized » Thu Apr 05, 2018 4:32 pm

The idea is that one mesh is deforming and one is static. The artist wants to do all additional deformation on the static mesh since it is much easier to control, and be able to blend in these new deformations on the already deforming object.

My idea was to use something that could be relative even with deformation and thought that I could use the normal, rotate it to point in a direction that is stored in a mapping channel and move a certain distance ( also stored in a mapping channel ) to blend no matter how the object is deforming.

Does that make sense? Typing this out is harder than making the Genome!

User avatar
Bobo
Posts: 6085
Joined: Tue Nov 15, 2005 10:26 am
Location: Vancouver, Canada
Contact:

Re: Aligning one vector to another

Postby Bobo » Thu Apr 05, 2018 5:10 pm

Again, if you know the direction already, there is absolutely no point in rotating the existing normal - just read the direction from the mapping channel, normalize it if needed, multiply by the distance, and move your Position by the result. Rotating an existing normal to match a known direction is just a waste of nodes.
Borislav "Bobo" Petrov
Product Specialist
Thinkbox Software Inc.


Return to “Thinkbox Software - Genome”

Who is online

Users browsing this forum: No registered users and 1 guest