Converting No Limits 2 Rotational Data to CFrame

Hello,

Currently working on some code that will convert CSV data from No Limits 2 coasters to Roblox. The data here seems extremely similar to CFrame at first, but is in a completely different order.

Example data:

42.974400	4.450000	-61.200000	1.000000	0.000000	-0.000000	-0.000000	0.000000	-1.000000	0.000000	1.000000	0.000000

As expected, plugging this data directly into CFrame.new() yields a seemingly perfect result, but upon closer inspection it’s obvious that the rotation of the track is extremely broken in many areas


Managed to fix this in a rather… “questionable” way. Probably a much simpler way to do this but since the rotational data I posted above is basically just CFrame but out of order I figured I could just put it in order which worked surprisingly well:


local function toOrientation(q)
	return CFrame.new(
		q[1], -- x
		q[2], -- y
		q[3], -- z

		q[7], -- leftX
		q[10], -- upX
		q[4], -- fwdX

		q[8], -- leftY
		q[11], -- upY
		q[5], -- fwdY

		q[9], -- leftZ
		q[12], -- upY
		q[6] -- fwdY
	)
end

Given q is this data in table form, in order:

42.974400	4.450000	-61.200000	1.000000	0.000000	-0.000000	-0.000000	0.000000	-1.000000	0.000000	1.000000	0.000000

Marking solution for now unless anyone knows of a simpler way to go about this.

1 Like