diff --git a/Readme.md b/Readme.md index 490c263..ec993c7 100644 --- a/Readme.md +++ b/Readme.md @@ -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. @@ -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) @@ -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. @@ -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. @@ -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 @@ -108,7 +120,7 @@ allprojects { ```groovy dependencies { - implementation 'com.github.HexagonNico:VecMatLib:1.0' + implementation 'com.github.HexagonNico:VecMatLib:1.1' } ``` @@ -127,7 +139,7 @@ dependencies { com.github.HexagonNico VecMatLib - 1.0 + 1.1 ``` @@ -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