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: to 2 lern cfame

Previous Thread :: Next Thread 
Weirdraidercs35 is not online. Weirdraidercs35
Joined: 14 May 2015
Total Posts: 2275
07 Oct 2016 12:25 AM
^ any tutorials on advanced/ intermediate stuff

ty al skids


im a mlg
Report Abuse
PhantomVisual is not online. PhantomVisual
Joined: 08 Apr 2011
Total Posts: 2025
07 Oct 2016 12:26 AM
I need CFrame tutorial as well. Someone is bout' to reach 1337 post. xd


Report Abuse
Wunder_Wulfe is not online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
07 Oct 2016 12:26 AM
use youtube and wiki these things already existed since like 2011
Report Abuse
Wunder_Wulfe is not online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
07 Oct 2016 12:28 AM
https://forum.roblox.com/Forum/ShowPost.aspx?PostID=199442230

focuses on the math rather than the use

so focus more on the use on the other link in that post
Report Abuse
Weirdraidercs35 is not online. Weirdraidercs35
Joined: 14 May 2015
Total Posts: 2275
07 Oct 2016 12:39 AM
ty.

question;

y do each of the axis s hav 3 values and what do they mean ?




im a mlg
Report Abuse
Wunder_Wulfe is not online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
07 Oct 2016 12:40 AM
read the post and you would know -.-

the first link in the post or the actual API wiki for CFrame
Report Abuse
Weirdraidercs35 is not online. Weirdraidercs35
Joined: 14 May 2015
Total Posts: 2275
07 Oct 2016 12:45 AM
i did, but idk what R10,R11,R12 mean. Is it a point that the y axis is facing in local space ?


im a mlg
Report Abuse
Wunder_Wulfe is not online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
07 Oct 2016 12:48 AM
No

R00,R01,R02 = first 3
R10,R11,R12 = second 3
R20,R21,R22 = last 3


they represent this:

if you were to move it 1 stud in the direction of that local axis, that is the vector you would need to add
Report Abuse
Wunder_Wulfe is not online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
07 Oct 2016 12:57 AM
it is not in local space because the axis are already local, using local space will make them never change

it is where it faces in a directional vector

if you want an example:

--PUT SCRIPT INSIDE A PART

local part = script.Parent

local beam1 = Instance.new("Part",workspace)
beam1.Material,beam1.BrickColor,beam1.Size = "Neon",BrickColor.new("Cyan"),Vector3.new(0,0,10)
beam1.Anchored = true
beam1.CanCollide = false
beam1.Transparency = 0.5

local beam2,beam3,beam4 = beam1:Clone(),beam1:Clone(),beam1:Clone()
beam2.Parent,beam3.Parent,beam4.Parent = workspace,workspace,workspace
beam2.BrickColor = BrickColor.new("Really red")
beam3.BrickColor = BrickColor.new("Lime green")
beam4.BrickColor = BrickColor.new("Really black")

while wait() do
beam1.CFrame = part.CFrame*CFrame.new(0,0,-5)
beam4.CFrame = part.CFrame*CFrame.new(0,0,5)
beam3.CFrame = part.CFrame*CFrame.Angles(math.rad(90),0,0)*CFrame.new(0,0,-5)
beam2.CFrame = part.CFrame*CFrame.Angles(0,math.rad(-90),0)*CFrame.new(0,0,-5)
end

--move the part after running it to see the angles
--red: X, green: Y, blue: Z, black: lookVector (-Z)
Report Abuse
Weirdraidercs35 is not online. Weirdraidercs35
Joined: 14 May 2015
Total Posts: 2275
07 Oct 2016 12:59 AM
so

1 0 0 is the unrotated x
0 1 0 is the unrotated y
0 0 1 is the unrotated z

if i wanted to rotate the x i would change it to 0.5,0,0 or something ?


im a mlg
Report Abuse
Wunder_Wulfe is not online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
07 Oct 2016 01:01 AM
no

dont do anything to them

just use radian angles by doing * CFrame.Angles(math.rad(X_degrees),math.rad(Y_degrees),math.rad(Z_degrees))

besides you cannot assign cframe any values because the userdata is locked
Report Abuse
Wunder_Wulfe is not online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
07 Oct 2016 01:02 AM
for example, anchor that part you put the script in, go to Test and click the arrow under the Play Solo button. Choose "Run"

Grab the brick and rotate it

Then press Ctrl + L (command + L on Mac) to toggle between local and global rotation

you should be able to spin the part around and the axis will move with it
Report Abuse
Wunder_Wulfe is not online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
07 Oct 2016 01:03 AM
If you want to know which one is local, if you rotate it, it should always spin around 1 axis at all times. You should be able to see which when you use local rotation
Report Abuse
Wunder_Wulfe is not online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
07 Oct 2016 01:04 AM
the roblox rotation tool should also correspond to the colors of the axis :) all rotation is local and for global rotation, use toObjectSpace.
Report Abuse
nooneisback is not online. nooneisback
Joined: 28 Feb 2012
Total Posts: 1672
07 Oct 2016 01:07 AM
CFrame is that hard to understand actually, except if you want to work with quaternions, which in fact can bring some interesting results.

To create a CFrame you use CFrame.new. Now there are multiple ways of describing the position and orientation. but we'll start with the simplest one:
CFrame.new(Position, PointTowardsWhichTheRotationWillLookAt)
The second argument represents a position vector into which direction the rotation will point at.

Next we have CFrame.Angles. This creates a CFrame with position 0,0,0 and a desired orientation in radians.

To get the position vector from a CFrame use CFrame.p, you can also get the rotation by using this (CFrame-CFrame.p); also, you have the x,y,z which will return the coresponding parts of the position.

Then we have the lookVector,upVector and the rightVector, they all represent a unit vector (magnitude of 1) of the rotation, except for different faces.

Inverse inverts the CFrame, lerp smoothly increments the CFrame to a desired point.

pointToObjectSpace sets the center CFrame to the CFrame's CFrame (sounds stupid, but there is no beter way to describe this), meanwhile pointToObjectSpace does the opposite, it makes the coordinates relative to the 0,0,0,0,0,0,0,0,0,0,0,0 CFrame.
On the other hand, pointTos return a vector transformed in the same manner.

components returns the whole CFrame.

Maths:

CFrame*CFrame offsets the CFrame by the 2nd CFrame. CFrame * CFrame.Angles basically rotates the first CFrame since Angles creates a CFrame with a 0,0,0 position.

CFrame+/-Vector3 returns a moved CFrame, while CFrame*Vector3... It once again transforms... It returns a Vector3 transformed to world coordinates? Probably accordingly to the given CFrame, not really that I ever used that.
Report Abuse
Weirdraidercs35 is not online. Weirdraidercs35
Joined: 14 May 2015
Total Posts: 2275
07 Oct 2016 01:16 AM
ty ;).

So I don't need to know about the r10,11,12 stuff ?

and those axis were all local cause they rotated with the part. If they didnt rotate they would be world.

(im using da info to lern how to manipulate welds and joints)


im a mlg
Report Abuse
Wunder_Wulfe is not online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
07 Oct 2016 01:19 AM
Welds are different slightly

C0 is the offset cframe of the pivot from part0
C1 is the offset cframe of the pivot from part1

the pivot has a cframe of part0*C0
or part1*C1

the pivot is the center of rotation for the welds
Report Abuse
Weirdraidercs35 is not online. Weirdraidercs35
Joined: 14 May 2015
Total Posts: 2275
07 Oct 2016 01:28 AM
8) Thanks for all the help !

(i hav to go to slep lol spanish test tomrow rip 1128 rip)


im a mlg
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