deform with matrix but keep normals intact ?

   2315   4   0
User Avatar
Member
1004 posts
Joined: April 2017
Offline
Hi!

I followed a tutorial on entagma about doing Spline Wraps. It's very nice for deforming objects but it requires flattening the geo before using the matrix. Doing so results in very funky normals.

Any way to preserve my custom normals?

http://www.entagma.com/rebuilding-the-c4d-spline-wrap-deformer-in-houdini/ [www.entagma.com]

-Olivier

Attachments:
Matrix_normal_problem.JPG (79.5 KB)

User Avatar
Member
10 posts
Joined: Feb. 2015
Offline
Would an attribute copy SOP do the trick? If your point count is the same, copying over the normals from your pre-deformed geometry might work.
User Avatar
Member
1004 posts
Joined: April 2017
Offline
It does half the work. When I use the attribute copy sop, I can transfer the normals. The problem is, if a normal on the source object points upward, and the matrix turns the geo upside down, the normal will still point upward.

I'm guessing I need to apply the matrix not only to the @P but to the @N as well. I'll test it out.

Thanks for helping!

-Olivier
User Avatar
Member
7737 posts
Joined: Sept. 2011
Offline
olivierth
It does half the work. When I use the attribute copy sop, I can transfer the normals. The problem is, if a normal on the source object points upward, and the matrix turns the geo upside down, the normal will still point upward.

I'm guessing I need to apply the matrix not only to the @P but to the @N as well. I'll test it out.

Thanks for helping!

-Olivier

There is a node for applying a matrix to all attributes that are “transformable” at once. It is called “Transform by Attribute”; it can accept a 4x4 matrix point attribute, as well as some other types.

Using this node, you don't have to modify vex code whenever you change the number attributes that need to be transformed.
User Avatar
Member
1004 posts
Joined: April 2017
Offline
Ah nice!

I'll try this sop soon!

Thanks.

-Olivier
  • Quick Links