kotlin-graphics/glm
Fork: 21 Star: 128 (更新于 2024-10-24 23:59:55)
license: 暂无
Language: Kotlin .
jvm glm
最后发布版本: v0.9.9.1-build-11 ( 2023-04-26 16:39:28)
This is the Kotlin port of OpenGL Mathematics (GLM), written by g-truc (repository), a header only C++ mathematics library for graphics software based on the OpenGL Shading Language (GLSL) specifications.
GLM provides classes and functions designed and implemented with the same naming conventions and functionality than GLSL so that anyone who knows GLSL, can use GLM as well in Kotlin and Java.
This project isn't limited to GLSL features. An extension system, based on the GLSL extension conventions, provides extended capabilities: matrix transformations, quaternions, data packing, random numbers, noise, etc...
This library works perfectly with OpenGL but it also ensures interoperability with other third party libraries and SDK. It is a good candidate for software rendering (raytracing / rasterisation), image processing, physic simulations and any development context that requires a simple and convenient mathematics library.
GLM is written entirely in Kotlin, but can be also used from Java. It is a platform independent library with no dependences other than kotlin-unsigned for unsigned support and kotlin-test for testing.
For more information about GLM, please have a look at the manual and the original API reference documentation. The source code and the documentation are licensed under both the Happy Bunny License (Modified MIT) or the MIT License.
Don't hesitate to contribute to the project by submitting issues or pull requests for bugs and features. Any feedback is welcome at elect86@gmail.com.
import glm_.vec2.Vec2
import glm_.vec3.Vec3
import glm_.mat4x4.Mat4
import glm_.glm
fun camera(translate: Float, rotate: Vec2): Mat4 {
val projection = glm.perspective(glm.PIf * 0.25f, 4.0f / 3.0f, 0.1f, 100.0f)
var view = glm.translate(Mat4(1.0f), Vec3(0.0f, 0.0f, -translate))
view = glm.rotate(view, rotate.y, Vec3(-1.0f, 0.0f, 0.0f))
view = glm.rotate(view, rotate.x, Vec3(0.0f, 1.0f, 0.0f))
val model = glm.scale(Mat4(1.0f), Vec3(0.5f))
return projection * view * model
}
How to retrieve it:
mary
repositories {
maven("https://raw.githubusercontent.com/kotlin-graphics/mary/master")
// or with magik plugin
//github("kotlin-graphics/mary")
}
dependencies {
implementation("kotlin.graphics:glm:0.9.9.1-11")
}
maven central
dependencies {
implementation("io.github.kotlin-graphics:glm:0.9.9.1-12")
}
You can find more info by mary
最近版本更新:(数据更新于 2024-10-14 09:17:14)
2023-04-26 16:39:28 v0.9.9.1-build-11
2023-04-25 21:09:31 v0.9.9.1-build-10
2023-04-14 15:15:01 v0.9.9.1-build-9
2023-04-13 21:12:01 v0.9.9.1-build-8
2023-04-04 18:09:11 v0.9.9.1-build-7
2020-09-06 22:03:28 v0.9.9.1-build-3
2020-05-27 17:16:08 v0.9.9.1-build-2
2020-03-09 18:30:07 v0.9.9.1-build-1
2019-12-11 18:15:20 v0.9.9.1-build-0
2019-02-26 22:44:30 v0.9.9.0-build-13
主题(topics):
android, geometry-library, glm, graphics, java, jogl, kotlin, lwjgl, math-library, mathematics, matrices, vectors
kotlin-graphics/glm同语言 Kotlin最近更新仓库
2024-11-03 22:53:00 jellyfin/jellyfin-androidtv
2024-11-01 21:50:36 FooIbar/EhViewer
2024-11-01 20:22:27 EhViewer-NekoInverter/EhViewer
2024-11-01 16:15:30 tiann/KernelSU
2024-10-28 20:42:50 gkd-kit/gkd
2024-10-27 19:26:53 salvogiangri/KnoxPatch