Well, yeah, I need formulas… I’ll try that link…
I’m old. Started in Machine Language, which only had ADD, SUBTRACT, and Multiply/Divide by 2, so I didn’t need math: We just fudged everything…
So for the RTS wargame on a Spherical Earth:
This places a Model correctly on a Hex of the globe; given that the hex is facing it’s Front, up; toward the “sky”:
code
local rel = c:toObjectSpace(tpart.CFrame);
tpart.CFrame = origin:toWorldSpace(rel);
But to Turn a Unit already on the globe toward an enemy unit, I have no idea…
My hack: I put both units mathematically, on a flat Earth; use CFrame LookAt; then back on the globe…
But if things get going with lots of units, I need more efficiency…
I just don’t got formulas…
The Insect AI on a flat-Earth; also wants to treat obstacles like spheres, and crawl on them; or on the underside of a dinning room table…, so normal CFrame.LookVectors don’t work…
I got stuff to give:
This deforms a cube made of checker-boards into a sphere…
function cubeToSphere(x,y,z)
return Vector3.new(
xmath.sqrt(1-y^2/2-z^2/2+(y^2z^2)/3),
ymath.sqrt(1-z^2/2-x^2/2+(x^2z^2)/3),
zmath.sqrt(1-x^2/2-y^2/2+(x^2y^2)/3)
);
end
Um…
Professional Game Designer; who knows an EXCELLLECT rOBLOX Artist; looking for Mathematician…
Let’s make beautiful music…
(Um… I don’t know how to use the Show-text-as-code delimiter. either…)
(1) Test124c41 - Roblox