Forum Groups
  All forums
    Help & Feedback
      Work in progress
      Finished Art
      Non-Max related

Maxunderground news unavailable

Scaling subobject in maxScript
show user profile  3joez
As stated here , you should first get the verts of your selection and the apply the transformations with matrices.

I'm reading two different ways to do this but I'm having troubles understanding some steps.
Why do you have to subtract the center of the transformation (how do you evaluate it?) from the transMatrix (is it the current transformation?).
Can somebody elaborate, or at least point me in the right direction? Thanks

read 308 times
3/17/2015 5:18:00 PM (last edit: 3/17/2015 5:19:40 PM)
show user profile  Garp
Say you have two positions pV and pC where pV is the position of some vertex on a mesh you want to scale and pC is the position of the center from which you want to scale. The vector (pV - pC) is the offset from the center to the vertex and is the value that needs scaling. Once you have the new offset, you add it back to the center and it gives you the new position of the vertex after scaling.
With a scaling factor k, it's k * (pV - pC) + pC.
Note that it doesn't matter in which coordinate system pV and pC are, as long as it's the same system.

ps: I didn't read the thread you linked to but I suspect it's something along those lines.

read 298 times
3/17/2015 6:59:28 PM (last edit: 3/17/2015 7:09:51 PM)
show user profile  3joez
Thanks Garp,I'll do some test scripts.

read 280 times
3/18/2015 10:23:32 AM (last edit: 3/18/2015 10:23:32 AM)
show user profile  Garp
A small algorithmic tip.
If during your tests you loop through the vertex selection, you should transform
k * (pV - pC) + pC
k * pV + (1 - k) * pC
Since (1 - k) * pC is the same each time around, you can speed up the computation by taking it out of the loop.

read 275 times
3/18/2015 12:59:31 PM (last edit: 3/18/2015 12:59:31 PM)
show user profile  3joez
Cool. That's beyond my idea but I wish there were more useful tips like that, around.

read 271 times
3/18/2015 1:57:28 PM (last edit: 3/18/2015 1:57:28 PM)
#Maxforums IRC
Open chat window