Skip to content

Commit d7797d5

Browse files
committed
Updated Readme
1 parent fc3ae11 commit d7797d5

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

Readme.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ VecMatLib provides simple data structures for vectors and matrices and an implem
55

66
## Project goals
77

8-
The goal of VecMatLib is to provide easy-to-use and efficient linear algebra operations, needed by any 3D application.
8+
The goal of VecMatLib is to provide easy-to-use and efficient linear algebra operations.
99

1010
Vectors and matrices structures are written in Scala to make the best use possible of Scala's operator overloading.
1111
All methods with symbolic names have an alias for better interoperability with java.
@@ -40,7 +40,7 @@ Vec3f c = a.plus(b);
4040
a = a.plus(b);
4141
```
4242

43-
The Vector API offers integer, single-precision and double-precision vectors with all their basic operations.
43+
The vector package offers integer, single-precision and double-precision vectors with all their basic operations.
4444

4545
```scala
4646
val a = Vec3f(1.0f, 1.0f, 1.0f)
@@ -60,7 +60,7 @@ Vec3f normal = a.normalized();
6060
Vec3f reflection = b.reflect(normal);
6161
```
6262

63-
## Matrix API
63+
## Matrix math
6464

6565
With VecMatLib you can create matrices for geometric transformations such as translation, rotation, and scale.
6666
None of these operations modify the matrix on which they are called.
@@ -81,6 +81,16 @@ Mat4f translation = Mat4f.translation(tx, ty, tz);
8181
position = translation.multiply(position);
8282
```
8383

84+
## Color math
85+
86+
VecMatLib also provides a structure to represent a color as four floating point values between 0.0 and 1.0 because colors are essentially 4D vectors.
87+
88+
```scala
89+
val white = Color(1.0f, 1.0f, 1.0f) // (red = 1.0, green = 1.0, blue = 1.0, alpha = 1.0)
90+
val green = Color(0.0f, 1.0f, 0.0f) // (red = 0.0, green = 1.0, blue = 0.0, alpha = 1.0)
91+
val transparentBlue = Color(0.0f, 0.0f, 1.0f, 0.5f) // (red = 0.0, green = 0.0, blue = 1.0, alpha = 0.5)
92+
```
93+
8494
## Using with LWJGL
8595

8696
VecMatLib can be used together with [LWJGL](https://lwjgl.org) to set uniform variables in shaders.
@@ -95,6 +105,8 @@ GL20.glUniform3f(location, lightPosition.x(), lightPosition.y(), lightPosition.z
95105

96106
VecMatLib can be added to any Java or Scala project as a dependency using [Jitpack](https://jitpack.io/).
97107

108+
[![](https://jitpack.io/v/HexagonNico/VecMatLib.svg)](https://jitpack.io/#HexagonNico/VecMatLib)
109+
98110
### Gradle
99111

100112
```groovy
@@ -108,7 +120,7 @@ allprojects {
108120

109121
```groovy
110122
dependencies {
111-
implementation 'com.github.HexagonNico:VecMatLib:1.0'
123+
implementation 'com.github.HexagonNico:VecMatLib:1.1'
112124
}
113125
```
114126

@@ -127,7 +139,7 @@ dependencies {
127139
<dependency>
128140
<groupId>com.github.HexagonNico</groupId>
129141
<artifactId>VecMatLib</artifactId>
130-
<version>1.0</version>
142+
<version>1.1</version>
131143
</dependency>
132144
```
133145

@@ -138,7 +150,7 @@ resolvers += "jitpack" at "https://jitpack.io"
138150
```
139151

140152
```sbt
141-
libraryDependencies += "com.github.HexagonNico" % "VecMatLib" % "1.0"
153+
libraryDependencies += "com.github.HexagonNico" % "VecMatLib" % "1.1"
142154
```
143155

144156
## Support the project

0 commit comments

Comments
 (0)