xvgigakid
|
  |
| Joined: 22 Jun 2008 |
| Total Posts: 4407 |
|
|
| 06 Jan 2012 06:41 PM |
I was thinking... And if I were to do something like P.CFrame.lookVector * 20 but on the Y axis instead of Z... How exactly would that be done >:o I tried many diffrent scenarios but none worked... |
|
|
| Report Abuse |
|
|
Aaaboy97
|
  |
| Joined: 05 Apr 2009 |
| Total Posts: 6612 |
|
|
| 06 Jan 2012 06:44 PM |
| I believe part of the CFrame matrix is TopVector and RightVector, I don't know which parts are though. |
|
|
| Report Abuse |
|
|
xvgigakid
|
  |
| Joined: 22 Jun 2008 |
| Total Posts: 4407 |
|
|
| 06 Jan 2012 06:48 PM |
CFrame.new( x, y, z, R00, R01, R02, R10, R11, R12, R20, R21, R22 )
Well x,y,z is obvoiusly CFrame.p :/ One of the other three rows is for Rotating the object. Im just gonna take a lucky guess and say thats the second row. Which leaves two more rows :/ |
|
|
| Report Abuse |
|
|
xvgigakid
|
  |
| Joined: 22 Jun 2008 |
| Total Posts: 4407 |
|
|
| 06 Jan 2012 06:49 PM |
'second row' By second row I meant R00, R01, R02 |
|
|
| Report Abuse |
|
|
|
| 06 Jan 2012 06:53 PM |
I just replied on your other thread.
[I need to learn an Algorithm to deal with noobs.] |
|
|
| Report Abuse |
|
|
xvgigakid
|
  |
| Joined: 22 Jun 2008 |
| Total Posts: 4407 |
|
|
| 06 Jan 2012 06:55 PM |
@Ratex K ill check it out :/ |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
xvgigakid
|
  |
| Joined: 22 Jun 2008 |
| Total Posts: 4407 |
|
|
| 06 Jan 2012 07:06 PM |
So... x, y, z, --Position(x,y,z) R00, R01, R02, --X Axis R10, R11, R12, --Y Axis R20, R21, R22 --Z Axis
And to get the distance from the Z axis you would ussually do CFrame.lookVector * x
How would I get the distance from the x/y axis? |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
|
| 06 Jan 2012 08:30 PM |
Just a minor correction. All 3 of those rows are rotation. |
|
|
| Report Abuse |
|
|
stravant
|
  |
 |
| Joined: 22 Oct 2007 |
| Total Posts: 2893 |
|
|
| 06 Jan 2012 08:53 PM |
local R = {CFrame:components()} Position = ( R[1], R[2], R[3] ) RightVector = ( R[4], R[7], R[10] ) TopVector = ( R[5], R[8], R[11] ) BackVector = ( R[6], R[9], R[12] )
The remaining three are obviously just the negations of those above. |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 06 Jan 2012 09:02 PM |
^That'll be good to know.
<'+1 Post. Ujelly?'> |
|
|
| Report Abuse |
|
|
1waffle1
|
  |
| Joined: 16 Oct 2007 |
| Total Posts: 16381 |
|
|
| 07 Jan 2012 01:42 AM |
| I thought it was just x, y, z, rotX, rotY, rotZ, useless, etc. |
|
|
| Report Abuse |
|
|
stravant
|
  |
 |
| Joined: 22 Oct 2007 |
| Total Posts: 2893 |
|
|
| 07 Jan 2012 12:34 PM |
"I thought it was just x, y, z, rotX, rotY, rotZ, useless, etc."
That wouldn't be very useful. The whole benefit of using a Matrix like that is that you don't have the problems associated with using axial rotations. It's just unit vectors so all calculations end up being really easy to do. |
|
|
| Report Abuse |
|
|
|
| 07 Jan 2012 02:24 PM |
| A facing direction also needs a direction for which way it is twisted around the axis. |
|
|
| Report Abuse |
|
|
stravant
|
  |
 |
| Joined: 22 Oct 2007 |
| Total Posts: 2893 |
|
|
| 07 Jan 2012 02:53 PM |
That's why a CFrame can be modeled as 3 unit vectors.
One unit vector also needs a rotation, but three unit vectors unambiguously defined a rotation in 3D space. (With 1 you have an infinite number of possible rotations around that axis, and with 2 you have two possible rotations, which are mirror images of and and other) |
|
|
| Report Abuse |
|
|