MadMax50 Posted June 15, 2019 Share Posted June 15, 2019 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 Quote Link to comment Share on other sites More sharing options...
vicvvsh Posted June 16, 2019 Share Posted June 16, 2019 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 Quote Link to comment Share on other sites More sharing options...
MadMax50 Posted June 17, 2019 Author Share Posted June 17, 2019 @vicvvsh Thank you very much this works great! Quote Link to comment Share on other sites More sharing options...
MadMax50 Posted June 17, 2019 Author Share Posted June 17, 2019 @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.. Quote Link to comment Share on other sites More sharing options...
willow wafflebeard Posted June 17, 2019 Share Posted June 17, 2019 (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 June 17, 2019 by willow wafflebeard Quote Link to comment Share on other sites More sharing options...
vicvvsh Posted June 17, 2019 Share Posted June 17, 2019 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. Quote Link to comment Share on other sites More sharing options...
MadMax50 Posted June 18, 2019 Author Share Posted June 18, 2019 @vicvvshAhh makes sense, thank you again! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.