Jump to content

Mixing Position based on active frame


MadMax50

Recommended Posts

Hello everyone

So I have a small issue in vex.

I have a start frame attribute moving progressively across a terrain. Now, I want to mix two states of geometry based on when my start frame happens. The value of the mix will be controlled by a ramp which will progressively mix from one state to another over a given number of frames. 

I almost have it working but it seems like my point positions are being stretched in one axis and not respecting the positions of the geometry I am working with. 

 

I am basically following this great presentation by Keith Kamholz and trying to recreate what he is teaching. You can see the effect I am trying to achieve at 22:32 minutes in

 

 

I will attach my file if anyone wants to take a look

Thank you

 

 

 

mixing_based_on_active.hip

Link to comment
Share on other sites

8 hours ago, MadMax50 said:

I almost have it working but it seems like my point positions are being stretched in one axis and not respecting the positions of the geometry I am working

Hello,

after for-each loop number of points of the geometry was changed and because of that lerp() does not work correctly. You can use unpacked geometry after loop, make it flat and plug in to the second input of the point wrangle

mixing_based_on_active_01.hipnc

Link to comment
Share on other sites

@vicvvshhey I have a quick question. In the expression you used to flatten out the Y position you wrote this:

@P.y = getbbox_min(0)[1];

What exactly is (0) and [1] doing ? In the getbbox_min help it states:
vector  getbbox_min(<geometry>geometry, string primgroup)

But I am still not sure what it means by the "string primgroup". and it also says thats the context for a vector whereas P.y is a float.

A little confusing..

Link to comment
Share on other sites

12 hours ago, MadMax50 said:

@vicvvshhey I have a quick question. In the expression you used to flatten out the Y position you wrote this:

@P.y = getbbox_min(0)[1];

What exactly is (0) and [1] doing ? In the getbbox_min help it states:
vector  getbbox_min(<geometry>geometry, string primgroup)

But I am still not sure what it means by the "string primgroup". and it also says thats the context for a vector whereas P.y is a float.

A little confusing..

This function return vector value [min.x, min.y, min.z] of bounding box coordinates of geometry and I take second element of this array min.y that is [1] index of that array and it has float value. When you use <string primgroup> in function you’re getting values for bounding box of primitives that in that group instead of all geometry.

My example was for plane geometry but if you have geometry like terrain better way is to store @P to i.e. v@origP before for-each loop and to swap them back after when you need original profile of geometry.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...