What CFrame's 3rd vector did... (CFrame.new(X, Y, Z, 1, 0, 0, 0, >> -1 <<, 0, 0, 0, 1)

Hello guys. I tried to understand why CFrames need 3 vectors to represent orientations, because third is “useless for me”. And I tried to “Invert” Y vector. And got very weird result:
image
I tried this first on mesh cone. Thought this’s mesh error. And then I tried this on Roblox part… And got inverted part. Should this be like this, or?..

And can someone please explain, why third vector even needed, why 2 for rotation isn’t enough?

EDIT:
Inverted part has inverted physics?
image
(it just tries to fall in diffirent direction)

How to replicate this:

  1. Create part with name “Glitch”
  2. Paste this in command line:
    local Glitch = workspace.Glitch Glitch.CFrame = CFrame.new(Glitch.Position.X, Glitch.Position.Y, Glitch.Position.Z, 1, 0, 0, 0, -1, 0, 0, 0, 1)
2 Likes

Mainly because you are “harcoding” CFrame properties that would not be normal.
You are kinda taking its inner side to outside… flipping normals.

As far as I understand if you want to manipulate the rotation of a CFrame its suggested to use CFrame * CFrame.Angles or any of the other methods provided in the CFrame documentation

Don’t thought that it’s possible to flip normals with CFrames…
But why we need third rotational vector?
image
Let’s look at this cube with arrows. 3 Directional vectors. XYZ. But…
image
What If we won’t use Z (blue) vector? I don’t see there any diffirence besides this “normals” problem. Is it the only problem why we need third Z-vector, because other way I can just erase it and work with 2 other vectors, because theoretically, 3-rd vector always will be at it’s position - perpendicular to other 2 vectors and in specific direction? You can’t just flip object’s XY vectors without seeing outcome.

Try playing with those parameters directly from the CFrame, you will see that you are changing the normals of the part.
Try using the methods provided in the CFrame documentation and you will find that you have total control over the parts without messing the part integrity.

Look at the data you are providing to the part by “hardcoding” the cframe:

CFrame.new(0, 10, 0, 1, 0, 0, 0, -1, 0, 0, 0, 1)

try this and you will see:

CFrame.new(0, 10, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)

Flipping normals…
Just stick to the documentation, it has plenty of methods that will resolve any orientation needs you have.

You are right the third vector is not necessarily needed to be inputted and can be found from using cross product as it says in the roblox documentation.

However its probably messing up the matrix multiplication math within the 3d engine and causing inverted normals. The exact math idk.

1 Like

you can mess up parts in all sorts of ways by changing the cframe values directly

4 Likes

Whatever @dthecoolest says I just learn and follow. I just use CFrames for everything, but dthecoolest actually understand how CFrame works. I just stick to whatever dc says :relieved:

1 Like