Relatives and global positionning

Hi! I think I can see two problems in runOutMatrix:

  • I think you aren’t accumulating the parent’s position, only its scale. The child’s total position should be createVector(parentX + parentScale * childX, parentY + parentScale + childY), as the parent’s scale also applies to the position relative to the parent.
  • It looks like you’re only accumulating position/scale from the direct parent, but that parent may also have a parent. Likely you will need to make your function recursive to account for that.

Read more here: Source link

Relatives and global positionning

Hi! I think I can see two problems in runOutMatrix:

  • I think you aren’t accumulating the parent’s position, only its scale. The child’s total position should be createVector(parentX + parentScale * childX, parentY + parentScale + childY), as the parent’s scale also applies to the position relative to the parent.
  • It looks like you’re only accumulating position/scale from the direct parent, but that parent may also have a parent. Likely you will need to make your function recursive to account for that.

Read more here: Source link