sayhisam1
|
  |
| Joined: 25 Nov 2009 |
| Total Posts: 2092 |
|
|
| 22 Jul 2014 08:29 PM |
When I type into output print(game.Workspace.sayhisam1.Torso.CFrame.lookVector) I get something like -0.966105103, 2.82760565e-022, -0.258149564 What exactly does this number mean? Is it representing a value? Is it in radians, degrees, or neither? I am so confused.. |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2014 08:33 PM |
http://www.roblox.com/Forum/ShowPost.aspx?PostID=39610971
some great explanations there |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2014 08:33 PM |
Alright well: Look vector is the way the "Front" is facing, all parts have a front just look in the surface tab to see which side is the front. And that would print whitch exact way, according to Vector3 your torso is looking. |
|
|
| Report Abuse |
|
|
sayhisam1
|
  |
| Joined: 25 Nov 2009 |
| Total Posts: 2092 |
|
|
| 22 Jul 2014 08:38 PM |
I don't really quite understand the concept of direction unit vector. Could someone explain this to me? Like, if my lookVector was (1,1,1), what would my player look like? |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2014 08:40 PM |
You would have multiple "Front" surfaces (I think) Since LookVector measures in scales from 0-1
But, (LookVectorX, LookVectorY, LookVectorZ) -- Maybe Y and Z might be switched, but I think Lua put then in alpha order. |
|
|
| Report Abuse |
|
|
sayhisam1
|
  |
| Joined: 25 Nov 2009 |
| Total Posts: 2092 |
|
|
| 22 Jul 2014 08:42 PM |
I know that it measures from 0-1, but how would you be able to use this information? What "direction" is (0,0,0) lookVector representing? Would your block in question be facing up? Down?
|
|
|
| Report Abuse |
|
|
|
| 22 Jul 2014 08:44 PM |
LookVector 0,1,0 Is facing up LookVector 0,-1,0 Is facing down |
|
|
| Report Abuse |
|
|
sayhisam1
|
  |
| Joined: 25 Nov 2009 |
| Total Posts: 2092 |
|
|
| 22 Jul 2014 08:45 PM |
Ah, thank you, that really clears up a lot. so 180* lookVector would get you the lookVector in degrees? Assuming that 0 is facing straight forwards, and -180 is down, and 180 is up. |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2014 08:50 PM |
| Yes, but that would scale 180 down to the 0-1 scale for you; So it would work. |
|
|
| Report Abuse |
|
|
sayhisam1
|
  |
| Joined: 25 Nov 2009 |
| Total Posts: 2092 |
|
|
| 22 Jul 2014 08:51 PM |
| so then if you were to turn a part upside down, so that it would be facing behind where it was, but upside down, what would the lookVector be then? |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2014 08:53 PM |
Just it's negative counterpart. part = script.Parent function reverse() wait(1) part.LookVector = (0, 1, 0) wait(1) part.LookVector = (0, -1, 0) end
This function just reverses it's LookVector over the Y axis.
|
|
|
| Report Abuse |
|
|
sayhisam1
|
  |
| Joined: 25 Nov 2009 |
| Total Posts: 2092 |
|
|
| 22 Jul 2014 08:58 PM |
Pretty sure lookVector is read-only. And is located in CFrame of a part...
On a side note, what is the rotation of a part, then? Can you convert between lookVector and rotation? |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2014 09:00 PM |
It's not read only, you can do stuff like Part.Position = NewPart.CFrame.LookVector * CFrame.new(2, 0, 0) |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2014 09:40 PM |
The "lookVector" is the "forward vector" of the 3 vectors that make up the rotation part of the CFrame. (Well, actually it is the negative back vector, but yeah)
Here is how the rotation part of a CFrame works:
UpX, RightX, BackX UpY, RightY, BackY UpZ, RightZ, BackZ
Where Up, Right and Back are 3 perpendicular unit vectors which represent the 3 facing directions of the matrix. |
|
|
| Report Abuse |
|
|
sayhisam1
|
  |
| Joined: 25 Nov 2009 |
| Total Posts: 2092 |
|
|
| 23 Jul 2014 12:08 PM |
| Ah, so the rotation part of the CFrame are the quaternions, right? |
|
|
| Report Abuse |
|
|