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: Get Positional axis for CFrame rotation vector?

Previous Thread :: Next Thread 
MICHEAL1988351 is online. MICHEAL1988351
Joined: 26 Jan 2015
Total Posts: 582
10 Nov 2017 11:43 AM
lets say that I have a CFrame rotational vector (lookVector, rightVector, upVector, etc) How can I get the positional axis that the rotational vector corresponds to with a blocks given orientation? The block orientation will always be of a 90 degree angle, so the positional axis will always either be X, Y, or Z.

Thanks
Report Abuse
Quasiduck is not online. Quasiduck
Joined: 28 Sep 2008
Total Posts: 2437
10 Nov 2017 12:00 PM
What do you mean, positional axis?



Do you just mean it's position? (Say, of a part.)

It would simply be CFrame.p

You can't work out a part's position alone from just lookvector, rightvector and upvector as they represent very different things.
Report Abuse
MICHEAL1988351 is online. MICHEAL1988351
Joined: 26 Jan 2015
Total Posts: 582
10 Nov 2017 12:24 PM
I mean what position axis (X Y or Z) the lookVector, rightVector, or upVector would be changing if it were moved in a way such as CFrame = CFrame + (CFrame.lookVector * x);

for example if a block's orientation is 0, 0, 0 and I move the upVector via

CFrame = CFrame + (CFrame.upVector * x)

then the Y positional axis's value would be added by x studs.

However if the block's orientation were something like 0, 0, 90, then moving the Block by its upVector would no longer effect the Y positional axis.

In my case, I am trying to figure out what positional axis a given CFrame rotational vector would effect with a given orientation.
Report Abuse
Weirdraidercs35 is online. Weirdraidercs35
Joined: 14 May 2015
Total Posts: 2275
10 Nov 2017 12:26 PM
u can use some trig for that


im a mlg
Report Abuse
ExtremeBuilder15 is online. ExtremeBuilder15
Joined: 01 May 2012
Total Posts: 3176
10 Nov 2017 12:31 PM
Are you trying to move along the x,y, or z axis?

local moveVector = Vector3.new(1,0,0)

CFrame = CFrame + moveVector -- Moves the CFrame 1 stud along the x axis.

Report Abuse
Quasiduck is not online. Quasiduck
Joined: 28 Sep 2008
Total Posts: 2437
10 Nov 2017 12:35 PM
Oh, that's simple.

If you change Orientation.y

You are practically spinning the rightVector, upVector and lookVector around the upVector. (Visualise the upvector as an axis in that direction where you spin everything around it.)


The upVector spun around the upVector is just the upVector.

So upVector stays the same.

The rightVector spun around the upVector has it's x and z values changed. (Notice it's not the y value that changes because UPvector.)

The lookvector spun around the upVector has it's x and changes too.


You can then probably work out what happens when you change Orientation.x and Orientation.z


Report Abuse
Quasiduck is not online. Quasiduck
Joined: 28 Sep 2008
Total Posts: 2437
10 Nov 2017 12:37 PM
Actually, I'm wrong. Very wrong.

I meant that the rightVector's x and z values in the part's ObjectSpace change.

(In global space, all x,y, & z can change.)


Everything I wrote in that post only makes sense if you view the world from the orientation of your part. i.e. ObjectSpace

Report Abuse
Quasiduck is not online. Quasiduck
Joined: 28 Sep 2008
Total Posts: 2437
10 Nov 2017 12:38 PM
The lookvector spun around the upVector has it's x and z changing too.*

In the CFrame's ObjectSpace *
Report Abuse
MICHEAL1988351 is online. MICHEAL1988351
Joined: 26 Jan 2015
Total Posts: 582
10 Nov 2017 12:40 PM
@quasi thanks i can figure the rest out now :)
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