generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: How would I get a certain axis of rotation

Previous Thread :: Next Thread 
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
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 is not online. murcury57
Joined: 30 Jun 2010
Total Posts: 90299
14 Mar 2015 12:56 PM
[ Content Deleted ]
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
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
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
14 Mar 2015 01:04 PM
1


Offer on R$2,353 and send on 23,547 RAP
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
14 Mar 2015 01:18 PM
2


Offer on R$2,353 and send on 23,547 RAP
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
14 Mar 2015 01:28 PM
3


Offer on R$2,353 and send on 23,547 RAP
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
14 Mar 2015 01:39 PM
4


Offer on R$2,353 and send on 23,547 RAP
Report Abuse
Graidlyz is not online. Graidlyz
Joined: 25 Dec 2011
Total Posts: 13357
14 Mar 2015 01:39 PM
local x,y,z = CurrentCamera.CoordinateFrame:toEulerAnglesXYZ()
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
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
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
14 Mar 2015 01:51 PM
5


Offer on R$2,353 and send on 23,547 RAP
Report Abuse
doepey590 is not online. 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
xXxMaggzxXx is not online. xXxMaggzxXx
Joined: 01 Feb 2015
Total Posts: 40
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
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
14 Mar 2015 02:03 PM
Doesnt change anything @doe


Offer on R$2,353 and send on 23,547 RAP
Report Abuse
HexC3D is not online. HexC3D
Joined: 30 Jun 2012
Total Posts: 10044
14 Mar 2015 02:20 PM
Can you elaborate bit further?
Report Abuse
HexC3D is not online. HexC3D
Joined: 30 Jun 2012
Total Posts: 10044
14 Mar 2015 02:21 PM
a*
Report Abuse
HexC3D is not online. 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
DrMathematica is not online. DrMathematica
Joined: 29 Aug 2008
Total Posts: 27268
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image