Skip to content

Commit

Permalink
Updated Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
HexagonNico committed Jan 23, 2023
1 parent fc3ae11 commit d7797d5
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ VecMatLib provides simple data structures for vectors and matrices and an implem

## Project goals

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

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

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

```scala
val a = Vec3f(1.0f, 1.0f, 1.0f)
Expand All @@ -60,7 +60,7 @@ Vec3f normal = a.normalized();
Vec3f reflection = b.reflect(normal);
```

## Matrix API
## Matrix math

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

## Color math

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.

```scala
val white = Color(1.0f, 1.0f, 1.0f) // (red = 1.0, green = 1.0, blue = 1.0, alpha = 1.0)
val green = Color(0.0f, 1.0f, 0.0f) // (red = 0.0, green = 1.0, blue = 0.0, alpha = 1.0)
val transparentBlue = Color(0.0f, 0.0f, 1.0f, 0.5f) // (red = 0.0, green = 0.0, blue = 1.0, alpha = 0.5)
```

## Using with LWJGL

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

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

[![](https://jitpack.io/v/HexagonNico/VecMatLib.svg)](https://jitpack.io/#HexagonNico/VecMatLib)

### Gradle

```groovy
Expand All @@ -108,7 +120,7 @@ allprojects {

```groovy
dependencies {
implementation 'com.github.HexagonNico:VecMatLib:1.0'
implementation 'com.github.HexagonNico:VecMatLib:1.1'
}
```

Expand All @@ -127,7 +139,7 @@ dependencies {
<dependency>
<groupId>com.github.HexagonNico</groupId>
<artifactId>VecMatLib</artifactId>
<version>1.0</version>
<version>1.1</version>
</dependency>
```

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

```sbt
libraryDependencies += "com.github.HexagonNico" % "VecMatLib" % "1.0"
libraryDependencies += "com.github.HexagonNico" % "VecMatLib" % "1.1"
```

## Support the project
Expand Down

0 comments on commit d7797d5

Please sign in to comment.