Processing: scale and transform -


in processing application want translate shape , scale it. coordinate, scale, , translate-values saved in objects. in each cycle use same translate-value per object , bigger scale-value.

the problem 'scale' somehow cumulated 'translate'- scale not happen in middle of object...

how can setup objects scaling happens @ center?

    (int = 1; < formen.size(); i++) {          form f = formen.get(i);          pushmatrix();          f.sx = f.sx * 2;         f.sy = f.sy * 2;         scale(f.sx, f.sy);         translate(f.tx, f.ty);          nostroke();           createshape();         beginshape();         vertex(f.ax, f.ay);         beziervertex(f.ax + f.kabx, f.ay, f.bx, f.by - f.kaby, f.bx, f.by);         beziervertex(f.bx, f.by + f.kbcy, f.cx + f.kbcx, f.cy, f.cx, f.cy);         beziervertex(f.cx - f.kcdx, f.cy, f.dx, f.dy + f.kcdy, f.dx, f.dy);         beziervertex(f.dx, f.dy - f.kday, f.ax - f.kdax, f.ay, f.ax, f.ay);          endshape();          popmatrix();          delay(5);     } 


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -