|
| 14 Mar 2015 12:49 PM |
Im trying to use (CurrentCamera.CoordinateFrame-CurrentCamera.CoordinateFrame.p) as the rotation of the camera, but how would I get a certain axis to be applied? The axis I want is when you look up and down, I dont really know which one it is xd
Offer on R$2,353 and send on 23,547 RAP |
|
|
| Report Abuse |
|
|
murcury57
|
  |
| Joined: 30 Jun 2010 |
| Total Posts: 90299 |
|
| |
|
|
| 14 Mar 2015 12:57 PM |
Im trying to get 1 axis of the rotation of CurrentCamera, not change the camera. The axis I want to use is ONLY the one when you look up and down
Offer on R$2,353 and send on 23,547 RAP |
|
|
| Report Abuse |
|
|
|
| 14 Mar 2015 01:04 PM |
1
Offer on R$2,353 and send on 23,547 RAP |
|
|
| Report Abuse |
|
|
|
| 14 Mar 2015 01:18 PM |
2
Offer on R$2,353 and send on 23,547 RAP |
|
|
| Report Abuse |
|
|
|
| 14 Mar 2015 01:28 PM |
3
Offer on R$2,353 and send on 23,547 RAP |
|
|
| Report Abuse |
|
|
|
| 14 Mar 2015 01:39 PM |
4
Offer on R$2,353 and send on 23,547 RAP |
|
|
| Report Abuse |
|
|
Graidlyz
|
  |
| Joined: 25 Dec 2011 |
| Total Posts: 13357 |
|
|
| 14 Mar 2015 01:39 PM |
| local x,y,z = CurrentCamera.CoordinateFrame:toEulerAnglesXYZ() |
|
|
| Report Abuse |
|
|
|
| 14 Mar 2015 01:45 PM |
That works when youre looking into one direction but flips upside down when you look the opposite ways
Offer on R$2,353 and send on 23,547 RAP |
|
|
| Report Abuse |
|
|
|
| 14 Mar 2015 01:51 PM |
5
Offer on R$2,353 and send on 23,547 RAP |
|
|
| Report Abuse |
|
|
doepey590
|
  |
| Joined: 16 Sep 2008 |
| Total Posts: 1187 |
|
|
| 14 Mar 2015 01:56 PM |
Try:
local _, _, _, xx, yx, zx, xy, yy, zy, xz, yz, zz = c0:components()
rotationAxis = Vector3.new(yz-zy, zx-xz, xy-yx)
? |
|
|
| Report Abuse |
|
|
|
| 14 Mar 2015 01:58 PM |
| well x is right/left, y is up/down, and z is in/out. So I think what your looking for is the y axis values. Dunno if this even helps you in any way, but I don't see anything else posted about it yet. |
|
|
| Report Abuse |
|
|
|
| 14 Mar 2015 02:03 PM |
Doesnt change anything @doe
Offer on R$2,353 and send on 23,547 RAP |
|
|
| Report Abuse |
|
|
HexC3D
|
  |
| Joined: 30 Jun 2012 |
| Total Posts: 10044 |
|
|
| 14 Mar 2015 02:20 PM |
| Can you elaborate bit further? |
|
|
| Report Abuse |
|
|
HexC3D
|
  |
| Joined: 30 Jun 2012 |
| Total Posts: 10044 |
|
| |
|
HexC3D
|
  |
| Joined: 30 Jun 2012 |
| Total Posts: 10044 |
|
|
| 14 Mar 2015 02:22 PM |
Oh your just looking for the y axis.
(x,y,z) |
|
|
| Report Abuse |
|
|
|
| 14 Mar 2015 02:57 PM |
The axis of rotation that looks up and down is the "pitch" axis. You get it like this:
local Camera = workspace.CurrentCamera local AxisOfPitch = Camera.CoordinateFrame:vectorToWorldSpace(Vector3.new(1,0,0));
If you want the actual angles that the camera is at, use :toEulerAnglesXYZ();
local RX,RY,RZ = Camera.CoordinateFrame:toEulerAnglesXYZ();
However, remember that toEulerAnglesXYZ is prone to error. Why? Because there are infinitely many possibilities that can be returned that represent the exact same rotation. It's best to use "axis angles." |
|
|
| Report Abuse |
|
|