Say I have an array containing nothing but positions (x, y, z) to make up an object (such as a cube). But I would like rotate the object around a given point that is also a position in the world.
Here’s a visual representation of what I am looking for.
Note that the red cube below is the origin point, and all the blue cubes are my group of positions formatted as the usual (x, y, z).
This:
To this: (rotated -45 degrees along the Y axis)
How can I achieve this effect without the assistance of CFrame or Vectors? Is there a simple way to achieve this?
local Origin = {0, 0, 0} -- The pivot position in the world (formatted as (x, y, z))
local TargetAngles = {0, -45, 0} -- The angle(s) that we want to rotate our positions to based on the pivot point
local Vertices = { -- Our group of positions or coordinates in the world (Formatted as (x, y, z))
{1, 1, 1},
{2, 1, 1},
{2, 2, 1},
{2, 2, 2},
{1, 2, 2},
{1, 1, 2},
{1, 2, 1},
{2, 1, 2},
}