←  APIs and Utilities

ComputerCraft | Programmable Computers for Minecraft

»

Matrix4 and Vector4 APIs

Emma's Photo Emma 02 Jun 2016

So I just got done porting a Matrix4f and a Vector4f api to lua. Decided to release the source in case anyone else needed them. So, here you go.
Matrix4: ewsWU1RZ
Vector4: M45y8y5z

They are created OOP style for your convenience
Usage:
  • Load them in with dofile
    Spoiler
  • To create a matrix4 or vector4 just call Matrix4f() or Vector4f() and an object will be returned
    Spoiler
Available functions:

Matrix4f:
Spoiler

Vector4f:
Spoiler

PS: If you don't know what these functions do, then you probably don't need these APIs.

Note: These apis were ported from this github repo

Please report any bugs you find here and I will fix them! :D Thanks!
Quote

Creator's Photo Creator 02 Jun 2016

Dude, awesome!
Quote

jv110's Photo jv110 05 Jun 2016

Well... VertexGL had that (+ quaternion). Not complaining tho, it's pretty good.
Quote

Emma's Photo Emma 07 Jun 2016

View Postjv110, on 05 June 2016 - 06:19 PM, said:

Well... VertexGL had that (+ quaternion). Not complaining tho, it's pretty good.
K.

Well, the libraries that are included in VertexGL are packaged with VertexGL and would need to be seperated from it for use. I posted this purely as a convenience for others. Also, I ended up adding quaternion to this, but I haven't updated the pastebin/op yet.
Thanks though! :)
Quote

apemanzilla's Photo apemanzilla 07 Jun 2016

Psst, return the API tables instead of loading them into _G!

matrix4 = dofile "matrix4"

Edited by apemanzilla, 07 June 2016 - 02:44 AM.
Quote

Emma's Photo Emma 07 Jun 2016

View Postapemanzilla, on 07 June 2016 - 02:44 AM, said:

Psst, return the API tables instead of loading them into _G!

matrix4 = dofile "matrix4"

Yeah, bad habit of mine that I really should stop doing. :P

Edit: Updated pastebins to return the tables
Edited by Incinirate, 07 June 2016 - 03:23 AM.
Quote