[quote] [quote=“VolcanoINC” post=53177][quote=“flatline115” post=53174][quote=“VolcanoINC” post=53173][quote=“litozinnamon” post=53171]

[/quote]
Thanks!
Now, say I rotated the part 20┬░ around the X axis, and now I wanted to continue from there and rotate it around the Z axis. Would I add Vector3.new(0,0,1) to v and keep normalizing, or is it more complicated than that?[/quote]
From the sounds of it you would just subtract 1 from the X value of the vector and at 1 to the Z value of the vector.[/quote]
From the looks of it, that would reverse the rotation I have made along the X axis and rotate it only along the Z axis.[/quote]
Didn’t you want it to rotate around the Z axis after 20 degrees anyways?[/quote]
Yes, but I wanted to keep the rotation I’ve made around the X axis.[/quote]
Then just multiply the CFrame instead of setting it to that directly ex:
[code]function changes(dir, val)
if dir == “x” then
v = Vector3.new(1,0, 0)
w = math.cos(val/2)
x2 = math.sin(val/2)*v.x
y2 = math.sin(val/2)*v.y
z2 = math.sin(val/2)*v.z
return w, x2
elseif dir == “y” then
v = Vector3.new(0,1, 0)
w = math.cos(val/2)
x2 = math.sin(val/2)*v.x
y2 = math.sin(val/2)*v.y
z2 = math.sin(val/2)*v.z
return w, y2
elseif dir == “z” then
v = Vector3.new(0,0, 1)
w = math.cos(val/2)
x2 = math.sin(val/2)*v.x
y2 = math.sin(val/2)*v.y
z2 = math.sin(val/2)*v.z
return w, z2
end
end
function calc(x, y, z, part)
for i = 1, 100 do
xs = {changes(“x”, x)}
ys = {changes(“y”, y)}
zs = {changes(“z”, z)}
part.CFrame = part.CFrame * CFrame.new(0, 0, 0, xs[2], ys[2], zs[2], math.sqrt(xs[1] + ys[1] + zs[2]))
wait()
end
end
calc(math.rad(5), math.rad(5), math.rad(5), Workspace.Part)
[/code]