of     1   

miked
#44135Sunday, June 24, 2007 6:53 PM GMT

I have a constantly changing CFrame, with something like this inside it: -67.0619431, 3.39999747, -22.9526978, 0.785206735, -7.05152733e-013, 0.619233727, 1.4891918e-013, 1, 9.49916578e-013, -0.619233727, -6.53665165e-013, 0.785206735 I want to be able to use the last and 3rd to last values (0.785 and -0.619) but cant think of a way of getting them out of the CFrame. I know to use CFrame.x, CFrame.y and CFrame.z to get the first three values out but there appears to be no way of getting anything else out... Alternatively: You can make a brick face something by using CFrame.new(Vector3.new(position), Vector3.new(position brick faces)) Is there any way of getting Vector3.new(position brick faces) out of a CFrame?
Are92
Top 100 Poster
#44139Sunday, June 24, 2007 6:55 PM GMT

eh... what is CFrame???
MrDoomBringer
Top 100 Poster
#44153Sunday, June 24, 2007 7:23 PM GMT

I'm not sure what each value in a CFrame output is, you'd have to ask Telamon that.
erik.cassel
Top 100 Poster
#44166Sunday, June 24, 2007 7:47 PM GMT

Hmm, that's an interesting omission. I should add some index operators to CFrame. What's also missing is a rotation class, among other things. Anyway, here's a workaround: All ROBLOX value types implement the __tostring metamethod. This means you can call tostring(foo) on a cframe foo and get a string back with comma-separated values. This is the same string you get when you call print(foo) Now you can use the Lua string functions to split the string into a table, etc. Ugly, but it should work. Finally, I'd be curious to know what you want to access the matrix values for. In general you should be able to do everything using the CFrame operators and transform functions. -Erik
miked
#44173Sunday, June 24, 2007 7:58 PM GMT

Thanks, I know exactly what you mean and the problem is now sorted. I am testing a lot of stuff with player positioning and aiming. Im trying to make a snowboard at the moment and will need to know what angle the player is facing. Also I want a dancing minigame at minigame world (copy what the dancer in the middle of the stage is doing - if he faces left you face left, when he jumps last to jump is out etc (also a "Simon says" game could be possible).
PCwiener
#44177Sunday, June 24, 2007 8:06 PM GMT

oo that sounds like fun!
stang90
#44270Sunday, June 24, 2007 9:42 PM GMT

i swear you guysjust make some of this up sometimes
erik.cassel
Top 100 Poster
#44341Sunday, June 24, 2007 10:30 PM GMT

I'll add the following functions in a future release: CFrame:components() -- return 12-number tuple of translation and 3x3 rotation matrix CFrame:toEulerAnglesXYZ() -- return 3-number tuple
miked
#44731Monday, June 25, 2007 7:11 AM GMT

Thanks, the second one is especially useful
Are92
Top 100 Poster
#44950Monday, June 25, 2007 6:51 PM GMT

rotation matrix?? WOW sound fun
ninetailfox
#45610Tuesday, June 26, 2007 1:53 PM GMT

kool i cant wait and miked dont for get to update your admin door it still isnt leting me in and you said "i see you a lot in mini game world fox i geuss i can prmote you to admin" ok? ty ~ninetailfox~
snowwolf
#46165Wednesday, June 27, 2007 2:12 AM GMT

and I don't know a single thing the post said right after "I have a constantly changing Cframe, with something like this inside it:". I know I didn't really need to post this, but I think it's needed in this confusing paragraph that is so called a "post" :D
RobloxPolice
#46196Wednesday, June 27, 2007 2:43 AM GMT

I wish you would just supply an easier PitchYawRoll conversion and additions with CFRAMES instead of having to retrieve and update 12 parameters. But oh well!
jimmy347
#46350Wednesday, June 27, 2007 2:25 PM GMT

Woow it kind of does sound fun!
NilPill
#46197687Tuesday, April 26, 2011 1:36 AM GMT

Bump
dotHLP
#188358089Saturday, April 30, 2016 11:29 PM GMT

So many old and cool people R$340 | +1,575 | Certified Wizard
[rfa#hidefromsearch]
#188365612Sunday, May 01, 2016 1:32 AM GMT

[rfa#hidefromsearch]
ABrighterSeason
#188374578Sunday, May 01, 2016 3:45 AM GMT

ye nob scopr
MMORPGAILabs
#216185741Monday, May 08, 2017 11:18 AM GMT

1363 Necro!

    of     1