ROBLOX Cframe 我该怎么做?

发布于 2024-10-04 16:24:49 字数 48 浏览 0 评论 0原文

如何在 ROBLOX 上 Cframe 任何类型的砖块![alt text][1]

How do I Cframe any type of brick on ROBLOX ![alt text][1]

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(15

九厘米的零° 2024-10-11 16:24:50
Workspace.Brick.CFrame = CFrame.new(0, 0, 0)

这使得工作区中的砖块的 CFrame 为 0, 0, 0(在底座内)

Workspace.Brick.CFrame = Workspace.Brick.CFrame * CFrame.Angles(0, 0, 0)

这使得工作区中的砖块有倾斜。使用 math.pi*x,其中每个 x = 1 都会使砖块沿该方向倾斜 1 弧度。

Workspace.Brick.CFrame = CFrame.new(0, 0, 0)

That makes the Brick in Workspace have a CFrame of 0, 0, 0(Inside the base)

Workspace.Brick.CFrame = Workspace.Brick.CFrame * CFrame.Angles(0, 0, 0)

That makes the Brick in Workspace have a tilt. Use math.pi*x where for each x = 1 tilts the brick in that direction 1 radian.

轻许诺言 2024-10-11 16:24:50

使用 CFrame 库和对象成员来控制 CFrame 值。例如:

CFrame.new()

将创建一个新的CFrame,其矩阵设置为单位矩阵。您可以通过传入 3 个原始 X、Y、Z 值或 Vector3 值来设置 CFrame 的位置。

CFrame.new(Vector3.new(0, 5, 0) == CFrame.new(0, 5, 0)

还有向矢量旋转的能力。

CFrame.new(Vector3.new(0, 5, 0), CFrame.new(0, 2, 0))

通过使用 CFrame.Angles 函数,您可以创建欧拉角来旋转 CFrame。

CFrame.new() * CFrame.Angles(math.rad(20), 0, 0)

请注意,使用欧拉角时,角度以弧度表示,因此为了将弧度转换为度数,我使用了 Lua 中的 math.rad 函数。还有 CFrame 值的成员,因此您可以从 CFrame 检索其旋转。

CFrame.new():toEulerAnglesXYZ()

还有一些属性,例如“p”表示位置,“lookVector”表示 CFrame 指向的向量。

CFrame.new().p
CFrame.new().lookVector

矩阵本身可以使用组件来访问。

CFrame.new():components()

CFrame 值也可以使用对象和世界坐标进行更改。

CFrame.new():toObjectSpace(CFrame.new()) -- a tad pointless

您还可以将算术运算应用于 CFrame(以及 CFrame/Vector3 彼此)

CFrame.new() + CFrame.new(0, 2, 0)

这只是我的一些初步信息,因此我无法保证此信息的准确性。查看 ROBLOX Wiki 了解更多信息。

Use the CFrame library and object members in order to control the CFrame value. For example:

CFrame.new()

Will create a new CFrame whose matrix is set to the identity matrix. You can set a position to a CFrame by passing in 3 raw X, Y, Z values, or a Vector3 value.

CFrame.new(Vector3.new(0, 5, 0) == CFrame.new(0, 5, 0)

There is also the ability to rotate towards a vector.

CFrame.new(Vector3.new(0, 5, 0), CFrame.new(0, 2, 0))

By using the CFrame.Angles function, you can create euler angles to rotate a CFrame.

CFrame.new() * CFrame.Angles(math.rad(20), 0, 0)

Do note that when using euler angles, angles are represented in radians, so in order to convert radians to degrees, I used the math.rad function in Lua. There are also members of CFrame values, so you from a CFrame, you can retrieve its rotations.

CFrame.new():toEulerAnglesXYZ()

There are also properties like "p" for position, and "lookVector" for the vector the CFrame is pointing towards.

CFrame.new().p
CFrame.new().lookVector

The matrix itself can be accessed using components.

CFrame.new():components()

Also CFrame values can be altered using object and world coordinates.

CFrame.new():toObjectSpace(CFrame.new()) -- a tad pointless

You may also apply arithmetic operations to CFrames (and CFrames/Vector3s to each other)

CFrame.new() + CFrame.new(0, 2, 0)

That's just some initial information off the top of my head, I can't guarantee the accuracy of this information because of this. Check out the ROBLOX Wiki for more information.

伤痕我心 2024-10-11 16:24:50

首先,转到你的位置,然后单击 RobloxStudio(左侧的黑色按钮,上面写着“iii”),然后单击工具箱按钮(有 2 个工具,橙色和蓝色),然后单击“向下箭头”(黑色)然后,单击免费模型。之后,单击搜索栏并输入“edit cframe”,然后单击一个空白点,然后单击“1”,但首先输入至少 2 个积木,然后单击一个积木并使用显示的 gui。仅此而已。

First,go your place then click RobloxStudio (Black button on the left that says "iii"), then, click the toolbox button (with 2 tools, orange and blue), then, click the "down arrow" (black) Then, click free models. After that click the search bar and put in "edit cframe" then click a blank spot, then click "1" but first put in at least 2 bricks in then click a brick and use the gui that shows up.thats all.

Game.Selection:Get()1 v.CFrame =
v.CFrame + Vector3.new(0, 0, 0)

这就是我更喜欢使用的,尽管您可以更改/添加内容,例如 EulerAnglesxyz()

它看起来像这样:

Game.Selection:Get()1 v.CFrame =
v.CFrame + Vector3.new(0, 0, 0) 和 v.CFrame = v.CFrame + EulerAnglexXYZ(0, 0, 0)

如果我可能不正确,请纠正我。
谢谢,
iTerm

Game.Selection:Get()1 v.CFrame =
v.CFrame + Vector3.new(0, 0, 0)

That is what I'd prefer to use though you could change/add stuff to it such have the EulerAnglesxyz()

It will look like this:

Game.Selection:Get()1 v.CFrame =
v.CFrame + Vector3.new(0, 0, 0) and v.CFrame = v.CFrame + EulerAnglexXYZ(0, 0, 0)

If I may not be correct, please correct me.
Thanks,
iTerm

怪我入戏太深 2024-10-11 16:24:50

请参阅 http://wiki.roblox.com/index.php/CFrame_positioning

game.Workspace.Brick.CFrame = CFrame.new(0, 10, 0) 用于定位

game.Workspace.Brick.CFrame = Workspace.Brick.CFrame * CFrame.fromEulerAnglesXYZ(0, 0, 0 ) 对于倾斜

只需编辑 () 之间的值

See http://wiki.roblox.com/index.php/CFrame_positioning

game.Workspace.Brick.CFrame = CFrame.new(0, 10, 0) for positioning

game.Workspace.Brick.CFrame = Workspace.Brick.CFrame * CFrame.fromEulerAnglesXYZ(0, 0, 0) for tilting

just edit the values in between the ()

自演自醉 2024-10-11 16:24:50

使用 cframe 的最简单方法是通过 cframe 工具(在免费模型或目录上获取一个,请注意其中一些可能会被感染),但存在一些问题,cframe 工具仅适用于锚定的砖块,并且它们不告诉无论您是否要进入砖块内部,使用命令栏进行 cframeing 都将允许您进行 cframe 但不会让砖块进入其他砖块。我推荐 cframe 工具,因为你可以轻松使用它,并且构建模式的人会更容易,而且对于高级玩家来说,玩这样有趣的东西很有趣。另外cframe工具有更多选项,你可以看到它处于什么程度和位置,随意调整,无需打字,你可以进入其他砖块内部,并且很容易看到它是否重叠。只需取消选择,您就会看到。使用 CFRAMER 工具,而不是动画师!机制上存在巨大差异,而且事实上它会合作。我从来没有找过动画师合作。 :P

The easiest way to cframe is through a cframe tool (get one on free models or the catalog, be aware some might be infected), there are some problems with that though, cframe tools only work well on anchored bricks, and they do not tell you if you are going inside the brick or not, cframing with the command bar will allow you to cframe but without having bricks going into other bricks. I reccomend the cframe tool because you can use it easily and build mode people ajust alot easier, and it's fun for the advanced player to play around with something fun like that. Plus the cframe tool has more options, you can see what degree and place it's at, ajust at will, no typing, you can go inside other bricks, and it's pretty easy to see if it's overlapping or not. Just deselect and you'll see. Use a CFRAMER TOOL, NOT A ANIMATOR! There's a huge difference in mechanics, and the fact that it will acually cooperate. I've never gotten an animator to cooperate. :P

仅此而已 2024-10-11 16:24:50

只需在游戏中插入一块砖块。锚定它。然后转到免费模型。输入 cframe 或 cframe 工具。然后选择一个单击它,然后抓住它。按砖块,然后这取决于您获得的 cframe 工具类型。;D

Just insert a brick at your game.Anchor it.Then go to free models.Type cframe or cframe tool.Then pick one click it then grab it.Press on the brick then it depends what type of cframe tool you got.;D

慢慢从新开始 2024-10-11 16:24:50

我找到了一种非常简单的 CFrame 砖块方法。打开 ROBLOX studio,转到“查看”>“输出和查看>工具栏>命令。现在,在工作区中选择您想要 CFrame 的程序块。在命令栏中,放置以下脚本:

v = Game.Selection:Get()[1] v.CFrame = v.CFrame + Vector3.new(0, 0, 0)

并输入它。将最后三个数字 (0, 0, 0) 更改为您希望砖块移动的螺柱。第一个数字是左和右,第二个数字是上和下,第三个数字是近和远(深度)。

这就是我使用 CFrame 的方式,原因有多种:

  • 速度很快
  • 如果你将变量设为很小的小数,你就可以非常精确地放置砖块。
  • 您不必经常在脚本中重新输入程序块的名称,只需选择您想要 CFrame 的程序块即可。

    <前><代码> ~Davillion

I have found a pretty easy way to CFrame bricks. Open up ROBLOX studio, go to View > Output and View > Toolbars > Command. Now, select the brick in Workspace that you wish to CFrame. In the Command bar, place the following script:

v = Game.Selection:Get()[1] v.CFrame = v.CFrame + Vector3.new(0, 0, 0)

And enter it. Change the last three numbers, (0, 0, 0) to the studs in which you want your brick to move. The first number is left and right, the second is up and down, and the third is close up and far away (depth).

This is how I CFrame because of multiple reasons:

  • It is quick
  • If you make the variables really tiny decimals, you can place the brick very precisely.
  • You do not constantly have to reenter the names of your bricks in your script, you simply select the brick you want to CFrame.

                                                                   ~Davillion
    
绅刃 2024-10-11 16:24:50

这是我制作的C-Frame工具包:
http://www.roblox.com/Bubbas-C -frame-Tool-Pack-item?id=41704811
这些工具非常不言自明。

Here is a C-Frame tool pack made by me:
http://www.roblox.com/Bubbas-C-frame-Tool-Pack-item?id=41704811
The tools are pretty self-explanitory.

佞臣 2024-10-11 16:24:50

Workspace.Brick.CFrame = CFrame.new(0, 0, 0) --基本上更改工作空间中名为“Brick”的部件的位置。为此使用 CFrmae 很好,因为使用它,您可以遍历对象。

Workspace.Brick.CFrame = Workspace.Brick.CFrame * CFrame.Angles(0, 0, 0) --使用新方法:3,这会将工作空间中名为“Brick”的零件沿其轴旋转 x 弧度 x = 你的数量
你应该这样做

Workspace.Brick.CFrame = CFrame.new(0, 0, 0) --Basically changing the Position of a Part in Workspace named "Brick". Using CFrmae for this is good because with it, you can go through objects.

Workspace.Brick.CFrame = Workspace.Brick.CFrame * CFrame.Angles(0, 0, 0) --Use the new way :3, this Rotates a Part in Workspace named "Brick" on it's axis by x Radians x = your amount
You should do it this way

空城缀染半城烟沙 2024-10-11 16:24:50

嗯,这是除了使用工具之外最简单的方法之一。您可以在 Roblox Studio 中打开命令栏,甚至可以在构建中打开。然后输入此内容

x = Game.Selection:Get()[1] x.CFrame = x.CFrame + Vector3.new(0, 0, 0)

(0, 0, 0) 更改为您想要的位置

示例:

(1, 2, 3)

希望我有所帮助,

〜TheBinkyp

Well, here is one of the most simple ways, other than using a Tool. You can open up your Command Bar in Roblox Studio, Or even in build. And type this

x = Game.Selection:Get()[1] x.CFrame = x.CFrame + Vector3.new(0, 0, 0)

Change the (0, 0, 0) to the position you want it to be

Example:

(1, 2, 3)

Hope I helped,

~TheBinkyp

对你再特殊 2024-10-11 16:24:50

您可以通过代码设置砖块的CFrame。您可以将砖块的 CFrame 设置为等于 CFrame 对象。有关“CFrame”的信息可以在这里找到:“https://wiki.roblox.com /index.php?title=CFrame'
请注意,'CFrame.new()' 将具有 (0, 0, 0) 的坐标和旋转。

local cFrameObject = CFrame.new()
brick.CFrame = cFrameObject

影响砖块 CFrame 的另一种方法是使用 ROBLOX Studio 插件或在游戏中使用 CFrame 工具。

You can set the CFrame of a a brick via code. You can set the CFrame of a brick equal to a CFrame object. Information about 'CFrame' can be found here: 'https://wiki.roblox.com/index.php?title=CFrame'
Note that 'CFrame.new()' will have the coordinates and rotation of (0, 0, 0).

local cFrameObject = CFrame.new()
brick.CFrame = cFrameObject

Another way to affect the CFrame of a brick is by using a ROBLOX Studio Plug-in or use a CFrame tool ingame.

人事已非 2024-10-11 16:24:50

坐标系(CFrame)是一种表示位置的方式,要使用它,您需要使用 Vector3 或其他 CFrame,您可以通过多种方式更改 Frame:
1:获取另一个CFrame
您可以获取零件的 CFrame 并将其用作参考,如果您想添加一些数学运算将其更改为您想要的

reference = workspace.InsertYourPartHere
part = Instance.new("Part",workspace)
part.CFrame = reference.CFrame + Vector3.new(0,(reference.Size.Y / 2),0)

2:制作一个新的 CFrame
使用 Vector3 和 CFrame 您可以更改零件的位置

part = Instance.new("TrussPart",workspace)
part.CFrame = CFrame.new(Vector3.new(math.random(0,2487),math.random(0,8),math.random(0,2487)))

,这就是 CFrame 的基础知识...还有更多 CFrame 函数,例如 CFrame.Angles ,它可以解释自己

a coordinate frame (CFrame) is a way of saying position, to use it you need to use Vector3 or another CFrame, you can change a Frame by many ways:
1: getting another CFrame
you can take a part's CFrame and using it as reference and if you want add some math operations to change it to the one you want

reference = workspace.InsertYourPartHere
part = Instance.new("Part",workspace)
part.CFrame = reference.CFrame + Vector3.new(0,(reference.Size.Y / 2),0)

2: making a new CFrame
using Vector3 and CFrame you can change a part's position

part = Instance.new("TrussPart",workspace)
part.CFrame = CFrame.new(Vector3.new(math.random(0,2487),math.random(0,8),math.random(0,2487)))

and so that's the basics of CFrame.... there's more CFrame functions like CFrame.Angles which explains itself

千と千尋 2024-10-11 16:24:50

试试这个,你可以使用 Vector3 到 CFrame:

MyVector3 = Vector3.new(1,2,3)
workspace.Brick.CFrame = CFrame.new(MyVector3)

Try this, you can use a Vector3 to CFrame:

MyVector3 = Vector3.new(1,2,3)
workspace.Brick.CFrame = CFrame.new(MyVector3)
寒尘 2024-10-11 16:24:50

酷是错误的。

Workspace.Brick.CFrame = CFrame.new(0, 0, 0)

-- 基本上更改了名为 Brick 的工作区中零件的位置。为此使用 CFrame 很好,因为使用它,您可以遍历对象并使用角度。

Workspace.Brick.CFrame = Workspace.Brick.CFrame * CFrame.Angles(0, 0, 0)

-- 您还可以使用新的方式,例如使用度角或弧度来旋转对象。

Cool is wrong.

Workspace.Brick.CFrame = CFrame.new(0, 0, 0)

-- Basically changing the Position of a Part in Workspace named Brick. Using CFrame for this is good because with it, you can go through objects and use angles.

Workspace.Brick.CFrame = Workspace.Brick.CFrame * CFrame.Angles(0, 0, 0)

-- You can also use the new way, for example using Degree Angles or Radians to rotate objects.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文