A 4-dimensional object system that allows for the rendering (and positioning / rotation) of any 4-dimensional meshes. The position / orientation system behaves exactly how CFrames behave (but in 4-dimensions) and the rendering system can display objects as both cross-sections and projections.
For example, here are the cross-sections of three (of six) 4-dimensional platonic solids (the 16-cell, 8-cell (tesseract), and 5-cell). Rotations are defined by
CFrame4.fromAngles(-angle, angle, angle, -angle, -angle, -angle)
-- xy, xz, xw, yz, yw, zw rotation planes
-- note that 4d rotations occur in 6 planes and don't correspond to axes, as opposed to 3d rotation which occurs in 3 planes and does correspond to axes
Here are the stereographic projections of the same platonic solids. You may have seen a rotating tesseract (middle) before. Rotations are defined by
CFrame4.fromAngles(0, 0, angle, -angle, 0, 0)
-- xy, xz, xw, yz, yw, zw rotation planes
Thanks to the module design, the code for the above (cross-sectional) video is as simple as
local CFrame4 = require(script.Shape4.CFrame4)
local Vector4 = require(script.Shape4.Vector4)
local Shape4 = require(script.Shape4)
local position = Vector4.new(10, 10, 50, 1)
local polytopes = {
Shape4.new("16-cell", 8, CFrame4.identity()),
Shape4.new("8-cell", 6, CFrame4.identity()),
Shape4.new("5-cell", 12, CFrame4.identity())
}
game:GetService("RunService").Heartbeat:ConnectParallel(function()
local angle = os.clock()
for i, solid in polytopes do
local frame = CFrame4.fromAngles(-angle, angle, angle, -angle, -angle, -angle) + position
solid:setCFrame(frame + Vector4.new(i * 15, 0, 0, 0))
solid:getRenderData()
end
task.synchronize()
for i, solid in polytopes do solid:renderFromData() end
end)