Jump to content
Sign in to follow this  
MadMax50

Mixing Position based on active frame

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

Share this post


Link to post
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

Share this post


Link to post
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..

Share this post


Link to post
Share on other sites
Posted (edited)

0 is the "input number" of the node,  and 1 means "2nd component" of the vector or array. this things counts from 0.

Edited by willow wafflebeard

Share this post


Link to post
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.

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  

×