0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

概要

robloxでassistantやってみた。
練習問題やってみた。

練習問題

スクリプトだけで、三角形を作れ。

手順

  • ReplicatedFirstに、LocalScriptを追加。
  • スクリプトを書く。

local wedge = Instance.new("WedgePart", workspace)
wedge.Anchored = true
wedge.TopSurface = Enum.SurfaceType.Smooth
wedge.BottomSurface = Enum.SurfaceType.Smooth
local a = Vector3.new(-10, 0, -10)
local b = Vector3.new(-5, 5, -10)
local c = Vector3.new(-5, -1, -10)
local ab, ac, bc = b - a, c - a, c - b
local abd, acd, bcd = ab:Dot(ab), ac:Dot(ac), bc:Dot(bc)
local right = ac:Cross(ab).unit
local up = bc:Cross(right).unit
local back = bc.unit
local height = math.abs(ab:Dot(up))
local w1, w2
w1 = wedge:Clone()
w1.Size = Vector3.new(1, height, math.abs(ab:Dot(back)))
w1.CFrame = CFrame.fromMatrix((a + b) / 2, right, up, back)
w1.Parent = workspace
w2 = wedge:Clone()
w2.Size = Vector3.new(1, height, math.abs(ac:Dot(back)))
w2.CFrame = CFrame.fromMatrix((a + c) / 2, -right, up, -back)
w2.Parent = workspace



写真

image.png

以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?