Masoud Posted August 2, 2023 Share Posted August 2, 2023 (edited) Hi guys, I'm looking for the simplest way to scale a geometry, using VEX (by an attribute) and I would like to be able to define the pivot position, too. I tried these codes. It works but I don't need the other transform parts (like Position, Rotation, and ...): vector t=chv("Translate"), r=chv("Rotation"), pr=chv("pivot_rotation"); vector p = v@myPivot; vector s = f@myScale; matrix transform = maketransform(0,0,t,r,s,p,pr); @P *= transform; There is a VEX function: scale(matrix &m, vector scale_vector); But I don't know how to use it. Thanks for helping. Edited August 2, 2023 by Masoud Quote Link to comment Share on other sites More sharing options...
Masoud Posted August 2, 2023 Author Share Posted August 2, 2023 I tried this one. It works, but there is no Pivot option: matrix m = ident(); vector myscale = chv("Scale"); scale(m, myscale); @P *= m; I need to set the pivot, too. Quote Link to comment Share on other sites More sharing options...
ThomasPara Posted August 2, 2023 Share Posted August 2, 2023 vector pivot = chv("pivot"); @P -= pivot; @P *= chf("scale"); @P += pivot; Simplest uniform scale, with pivot 1 1 Quote Link to comment Share on other sites More sharing options...
Masoud Posted August 4, 2023 Author Share Posted August 4, 2023 Thank you Thomas. 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.