C_Sharper
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 6405 |
|
|
| 26 Sep 2016 02:38 PM |
When I say,
CFrame.x
Does that contain the rotation and position? Or just the position?
I want to use this coordinate as the X position and rotation for something else. |
|
|
| Report Abuse |
|
|
Mitko0o1
|
  |
| Joined: 30 Nov 2010 |
| Total Posts: 5725 |
|
|
| 26 Sep 2016 02:40 PM |
| http://wiki.roblox.com/index.php?title=CFrame |
|
|
| Report Abuse |
|
|
C_Sharper
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 6405 |
|
|
| 26 Sep 2016 02:42 PM |
I'll just explain what I'm trying to do.
c.CFrame = thruster.CFrame * CFrame.new(0,55,64) * CFrame.Angles(math.rad(-28),0,0)
I'm setting the camera angle to lock-on to the plane. But I want it to ignore one rotation axis of the plane, and I'm kinda stuck on that. |
|
|
| Report Abuse |
|
|
C_Sharper
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 6405 |
|
| |
|
LockFocus
|
  |
| Joined: 31 Aug 2013 |
| Total Posts: 1044 |
|
|
| 26 Sep 2016 03:52 PM |
say we got CFrame.new(1, 2, 3) saying print(CFrame.new(1, 2, 3).x) will print 1 |
|
|
| Report Abuse |
|
|
LockFocus
|
  |
| Joined: 31 Aug 2013 |
| Total Posts: 1044 |
|
|
| 26 Sep 2016 03:53 PM |
You can get the Euler angles with this, if that's what you want
http://wiki.roblox.com/index.php?title=Euler_angles#Converting_a_CFrame_to_Euler_angles |
|
|
| Report Abuse |
|
|
C_Sharper
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 6405 |
|
|
| 26 Sep 2016 04:07 PM |
| Oh thanks. I'll experiment. ^_^ |
|
|
| Report Abuse |
|
|
C_Sharper
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 6405 |
|
|
| 26 Sep 2016 06:07 PM |
Well actually that's exactly what I did try.
What happens now is that the camera literally locks-on to the plane. When you rotate it you don't even notice anything rotated cause the camera is completely locked on to it. I want everything to lock on, but I want to make it ignore this one rotation axis. And for some reason I can't figure it out.. |
|
|
| Report Abuse |
|
|
C_Sharper
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 6405 |
|
|
| 27 Sep 2016 11:05 AM |
| Any suggestions? I'll probably try some tinkering with a newly constructed cframe pointing at the angle I want. |
|
|
| Report Abuse |
|
|
nox7
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 27467 |
|
|
| 27 Sep 2016 12:00 PM |
Hello,
I believe I can be of some help; but I am hindered by your explanation and my inability to comprehend it. Do you have an example place of what is currently happening and maybe a place (could be someone else's) of the desired result. Maybe a video, GIF, or still image set.
Anything to help me visualize your issue. I'm sure i can solve it. |
|
|
| Report Abuse |
|
|
C_Sharper
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 6405 |
|
|
| 27 Sep 2016 12:04 PM |
Thanks for the reply nox!
Right now I'm tinkering with the focus of the camera, if I can't get that working, then I will send you a gif. :) |
|
|
| Report Abuse |
|
|
nox7
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 27467 |
|
|
| 27 Sep 2016 12:06 PM |
| Alright, I'll be keeping an eye out. My plan is to either use axis-angles to restrict the rotation to two axes or recreate the matrix by hand. |
|
|
| Report Abuse |
|
|
C_Sharper
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 6405 |
|
|
| 27 Sep 2016 12:22 PM |
| I was trying to figure out how I could achieve what I need with the CFrame components, but I'm not too experienced with each component. So here is the gif: ################################# (a ######## See how when I bank the plane (turn it to the left or right) the camera is attached to it so you don't even notice the wings are rotating? I'm trying to make it so the camera is attached to the plane, but I want it to ignore that particular rotation axis. If that makes sense! |
|
|
| Report Abuse |
|
|
C_Sharper
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 6405 |
|
|
| 27 Sep 2016 12:22 PM |
Oh roblox...
/13d3b73afec0a8047d9a3ac3c76f9d7e
Gee-ah-zoe link ^ |
|
|
| Report Abuse |
|
|
C_Sharper
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 6405 |
|
| |
|
C_Sharper
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 6405 |
|
| |
|
C_Sharper
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 6405 |
|
| |
|
C_Sharper
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 6405 |
|
|
| 27 Sep 2016 06:07 PM |
Let me describe what I'm trying to do.
I'm setting the camera's CFrame to this CameraAngle part's CFrame. (a brick)
But I don't want a certain rotation axis of the camera to be changed. (Aka, I want the plane to lock-on to the plane at all times, but I don't want it so when you rotate the wings of the plane the camera responds to that, I want the camera to remain centered)
Although this makes for a more realistic effect, it's harder to steer the plane and it's not the angle I'd like. |
|
|
| Report Abuse |
|
|
C_Sharper
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 6405 |
|
| |
|
nox7
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 27467 |
|
|
| 27 Sep 2016 09:09 PM |
It's hard for me to understand what you want, as you are lacking (I mean no offense) technical terms for which axis you want. Do you want:
The local Z,X, or Y axis? Imagine a pole on these axes and the rotation spins around the pole. Which plane? |
|
|
| Report Abuse |
|
|
C_Sharper
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 6405 |
|
|
| 27 Sep 2016 09:34 PM |
Any axis, as I just need a general idea of how to do what I'm trying to achieve.
What I'm trying to do, if what I stated is still unclarified, is to set the camera's CFrame to a part, but I don't want one of the rotation axis' of the camera to be set to the according axis of the brick, if that makes sense.
Right now when I rotate the wings of my plane the camera rotates according to the wing rotation so you don't even notice the wings rotated. I don't want to apply that rotation to the camera so you can actually see the wings move and that'll give the pilot a better perspective whilst piloting the plane.
Ugh I really hope this helps.. If it doesn't I'll try again. cx
Thanks for the reply my friend! |
|
|
| Report Abuse |
|
|
|
| 27 Sep 2016 10:09 PM |
Oh. Try Camera.CFrame=wing.CFrame*offsetCFrame
offsetCFrame is the cframe of the camera relative to the wings. Btw, you should look up stuff on matrices and maybe even quaternions if you're feeling brave. Knowing how the mathematics of this stuff works really helps. |
|
|
| Report Abuse |
|
|
C_Sharper
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 6405 |
|
|
| 28 Sep 2016 10:06 AM |
| Thank you, I'll experiment on my end with quaternions. :) |
|
|
| Report Abuse |
|
|
|
| 28 Sep 2016 12:11 PM |
| are you still working on that plane lmao you can just offset the cam and lerp the angles |
|
|
| Report Abuse |
|
|
C_Sharper
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 6405 |
|
|
| 29 Sep 2016 10:23 AM |
Still can't really figure this algorithm out, tried some stuff with the components of the quaternion of the camera.
A perfect example of the cam manipulation I'm trying to achieve is something similar to Velocity Flight Simulator. |
|
|
| Report Abuse |
|
|