Rotate a structure block generated by a structure.
When you load a rotated structure there are blocks which change, such as logs, but if the structure contains another structure block that block doesn't change at all if rotated. I think it would be better if they did, tho, in order to totally rotate the strucure.
This could be done with a very simple formula:
taken "x" the x-coordinate of Relative Position of the original block, "z" the z-coordinate of Relative Position of the original block, "angle" the angle of rotation in degrees of the original block and "rotation" the angle of rotation in degrees of the structure that includes the block, the new values will be:
new_x = x*cos(rotation)-z*sin(rotation)
new_z = x*sin(rotation)+z*cos(rotation)
new_angle = (angle+rotation)mod360
Please sign in to leave a comment.