Monday, August 27, 2012

ICE: Scaling Particles From Bottom

A user on XsiBase was asking how to scale box particles from the base of the particle rather than from the center.

The easiest solution, if all particles are oriented upward, would be to add 1/2 of the yScale to the y position of the particles.  The problem arises when the particles are oriented out to the side.  Rather than just moving the particles upward, we need to move them along the direction they are pointing in.  This is easily accomplished by multiplying 1/2 of the yScale's 3d-vector (0,yScale/2, 0) by the rotational 3x3 matrix of the particle, and adding that to the particle's position.

No comments:

Post a Comment