Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 14bb5c4

Browse files
committed
implement matrix Scale
1 parent 79c3e98 commit 14bb5c4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎Assets/Scripts/HolisticMath.cs‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,16 @@ static public Coords Translate(Coords position, Coords vector)
105105
mQ = mv * mP;
106106
return mQ.AsCoords();
107107
}
108+
109+
static public Coords Scale(Coords position, Coords scale)
110+
{
111+
Matrix mQ;
112+
Matrix mS = new Matrix(4, 4, new float[] { scale.x, 0, 0, 0, 0, scale.y, 0, 0, 0, 0, scale.z, 0, 0, 0, 0, 1 });
113+
Matrix mP = new Matrix(4, 1, new float[] { position.x, position.y, position.z, 1 });
108114

115+
mQ = mS * mP;
116+
return mQ.AsCoords();
117+
}
109118

110119

111120
static public Coords Cross(Coords vector1, Coords vector2)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /