Jump to content
Sign in to follow this  
NodeBrain

Use color information to deform a geometry ??? [attribfromvolume] > [peak]

Recommended Posts

 

Hello, I'm just starting on Houdini and I have not found a solution to my problem on the internet ... 
How to transform a color information to locate a deformation?

Thanks

TEST_COLOR_MASK.PNG

TEST_COLOR_MASK_GEO.PNG

Share this post


Link to post
Share on other sites

build your deformation as you like and then use a pointwrangle to blend between initial state (input 0) and deformed state (input 1). I the wrangle write:

v@P = lerp(v@P, point(1, "P", @ptnum), v@Cd.y);

 

Share this post


Link to post
Share on other sites

If you want to store the displacement between two objects with the same topology, use

v@Cd = v@opinput1_P - v@P;

Apply the displacement with

v@P += v@Cd;

 

In case the topology differs, shoot rays:

vector pos_hit;
vector st_hit;
int prim = intersect(1, v@P, v@N * 5.0, pos_hit, st_hit);
vector dir = pos_hit - v@P;

v@Cd = dir;

You will loose high frequency surface details, though.

displacement.hipnc

Edited by konstantin magnus

Share this post


Link to post
Share on other sites

Thanks a lot for your help!

It's only been 4 days that I try to learn the software.
I did not start to learn the code and I did not know what to do to make it worked.

Thank you Drughi for your line of code ... It would be necessary to change what we call the OutPut of the "Attribfromvolume1"?

(And thank you very much Konstantin Magnus for your help. As soon as I have a more advanced level, I try to do your method).

As I explained, I've just started on this software (hard to learn) and I did not find the tutorials that really explain the philosophy of this software.
If you have links to tutorials.
I had worked a lot with the hypershade of maya (almost 20 years ago), and I did not find the same logic of connection ...

Thanks

TEST_COLOR_MASK_PAS_COMPRIS.PNG

Share this post


Link to post
Share on other sites

the attrib from volume should go in the first input so that the color is available for the pointwrangle. In the 2nd Input goes the peak or whatever you like.

Share this post


Link to post
Share on other sites

 

fantastic!!
It works! I understand better how the expression functions ...
I will be able to advance on my learning.

thank you very much Drughi !!! 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×