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: Simple question: Vector to CFrame

Previous Thread :: Next Thread 
PlaceRebuilder is not online. PlaceRebuilder
Joined: 29 Apr 2008
Total Posts: 1056
30 Apr 2016 10:28 AM
I want to know what the x,y,z components would be given a CFrame.

Ex:
I got a vector v1 = (0,1,0)
I got a brick looking up, meaning the lookvector of the bricks cframe is (0,1,0)
Then in the bricks cframe-cordinate, vector v1 is (1,0,0)

I'v tried all of the following:
CFrame:pointToWorldSpace(Vector3 v3)
CFrame:pointToObjectSpace(Vector3 v3)
CFrame:vectorToWorldSpace(Vector3 v3)
CFrame:vectorToObjectSpace(Vector3 v3)

None of them gave any resonable results.
Any idea what I'm doing wrong?
Report Abuse
PlaceRebuilder is not online. PlaceRebuilder
Joined: 29 Apr 2008
Total Posts: 1056
30 Apr 2016 10:32 AM
Really poorly explained but I hope someone get the point.
Report Abuse
Marienus is not online. Marienus
Joined: 02 Jul 2012
Total Posts: 118
30 Apr 2016 10:32 AM
CFrame.new(v3.X,v3.Y,v3.Z) ?

I don't really know what you are trying to do though.
Report Abuse
ray_1 is not online. ray_1
Joined: 18 Feb 2011
Total Posts: 464
30 Apr 2016 10:33 AM
not sure what you are trying to do
clarify?


Recommended username: PossessiveRay_1


Report Abuse
Casualist is not online. Casualist
Joined: 26 Jun 2014
Total Posts: 4443
30 Apr 2016 10:37 AM
local p = Vector3.new(1,0,0)
local lookVector = Vector3.new(0,1,0)
local z = -lookVector

CFrame.new(
p.x,p.y,p.z,
x.x,y.x,z.x,
x.y,y.y,z.y,
x.z,y.z,z.z
)

For a complete CFrame you have to define x or y (and the over can be solved for)


This said, I'm not sure what you're asking//trying to do as you haven't exactly specified what you're calling a reasonable result.
Report Abuse
PlaceRebuilder is not online. PlaceRebuilder
Joined: 29 Apr 2008
Total Posts: 1056
30 Apr 2016 10:39 AM
Nevermind, solved it.
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