Masoud Posted February 1, 2025 Share Posted February 1, 2025 Hi everyone, Could you please take a look at the image below? I'm working on scaling a curve (which isn't at the origin) using VEX code. I need the scaling to be based on point number 0 (@ptnum = 0). Does anyone have any ideas or suggestions on how to approach this? Thanks in advance! Scale.hip Quote Link to comment Share on other sites More sharing options...
osmanertasdiken Posted February 1, 2025 Share Posted February 1, 2025 You can achieve this using either VEX or a transform sop with an expression on the pivot translate, I included both methods in the hip file. Best, Scale_odForce.hiplc Quote Link to comment Share on other sites More sharing options...
Masoud Posted February 6, 2025 Author Share Posted February 6, 2025 Hi Osmaner Thank you for your response. In your file, when I change the point number, the curve shifts to an undesired location. Quote Link to comment Share on other sites More sharing options...
Masoud Posted February 6, 2025 Author Share Posted February 6, 2025 These codes helped me to achieve it: vector T = chv("T"); vector R = chv("R"); vector S = chv("S"); vector pivot = point(0, "P", chi("Point_Number")); matrix m = maketransform(0,0,T,R,S); matrix m2 = ident(); translate(m2,-pivot); m2 *= m; translate(m2,+pivot); v@P *= m2; 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.