Math question

I’m trying to create a blueprint that will spawn some meshes in a given area, defined by a rectangular bounds. It will start in a corner, create a row, then move to the next column, and so on.

I have this much done, and it looks fine as defined, but when you rotate the bounds, as you would expect, the items don’t follow - because the box extents are simply a radius on each axis. So I get that.

So what I’m trying to do is use a grid rotation formula:

newX = oldXcos(angle) + oldYsin(angle)
newY = oldYcos(angle) - oldXsin(angle)

But this doesn’t quite work. I think it’s because there is a disparity between the actual value of oldX and oldY, due to the fact that the center of the box extent is not at 0,0,0…

Help please?:slight_smile:

here is a solution

You guys make it look so easy!