Maxunderground news unavailable

Scaling subobject in maxScript 
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 387 times 3/17/2015 5:18:00 PM (last edit: 3/17/2015 5:19:40 PM)

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 377 times 3/17/2015 6:59:28 PM (last edit: 3/17/2015 7:09:51 PM)

3joez 
Thanks Garp,I'll do some test scripts.
read 359 times 3/18/2015 10:23:32 AM (last edit: 3/18/2015 10:23:32 AM)

Garp 
A small algorithmic tip. If during your tests you loop through the vertex selection, you should transform
k * (pV  pC) + pC into
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 354 times 3/18/2015 12:59:31 PM (last edit: 3/18/2015 12:59:31 PM)

3joez 
Cool. That's beyond my idea but I wish there were more useful tips like that, around.
read 350 times 3/18/2015 1:57:28 PM (last edit: 3/18/2015 1:57:28 PM)


