JOML

Started by Kai, May 31, 2015, 14:08:57

Previous topic - Next topic

Kai

There is now also a "Migrating from LWJGL 2" entry in JOML's Wiki.
Everyone coming from LWJGL 2 and trying to port their code to LWJGL 3 and JOML will find help there on what they need to do.

Additionally, if you are wondering how you can use JOML with LWJGL 3 in the first place, there is now a Simple LWJGL 3 Example. This example uses OpenGL 1.1.
If you want to know how to use JOML with OpenGL 2.0 and shaders, have a look at JOML with LWJGL 3 and Shaders.

FortressBuilder

In Vector3f.sub(float, float, float) the values are incremented instead of decremented. This is probably a typo.

    /**
     * Decrement the components of this vector by the given values.
     * 
     * @return this
     */
    public Vector3f sub(float x, float y, float z) {
        this.x += x;
        this.y += y;
        this.z += z;
        return this;
    }

Kai

Thanks a bunch for reporting! It has been fixed in #7c2d9e
If you find more issues or have suggestions, you can use the Issues section on GitHub.

Kai

The latest 1.2.0 Release of JOML is ready.
It has been put to real use, especially its quaternion classes, and a few issues have thankfully been found and resolved by @FortressBuilder.
Some new methods have found its way into the matrix and vector classes, such as project() and unproject() known from GLU, as well as angle() and angleCos() (thanks to @FortressBuilder for contribution) as well as methods to obtain a particular matrix row and column (thanks to @zmrodriguez91).
The matrix and vector classes can be considered stable and the API of existing methods will not change anymore in syntax or semantics, so you are encouraged to incorporate it in your own projects.

As always: If you feel that some feature is missing in JOML which holds you back from using JOML, feel free to post an issue or contribute.
We are always glad about help from others to drive JOML in directions to make it useful for real projects.

Kai

JOML has now two new repositories:

joml-camera

Currently, it features an arcball camera with acceleration/velocity/elapsed-time-based movement (i.e. it rotates/moves "smooth").
Hopefully, it will be useful for anyone. For me it is :)
The camera interface is rather ugly right now, but that will improve. See the demo mentioned below.

joml-lwjgl3-demos

This contains some showcases of how to use JOML with LWJGL 3. It also now features a simple OpenGL 1.1 demo using the ArcBallCamera.

BrickFarmer

I just tried the demo, nice work :)

I had to tweak one thing to get it to work on my mac, and that was to initialise width and height.  Maybe Windows does a resize call at startup that OSX doesnt?  I also get a 1/2 second black window before the scene renders, I can't test on my Windows box since I'm on the road at the moment.  Peter
Oculus Rift CV1, MBP 2016 - 2.9 i7 - Radeon Pro 460  OSX 10.12.4,  Win7 - i5 4670K - GTX1070.
Oculus Rift VR Experiments: https://github.com/WhiteHexagon

Kai

Yeah, thanks!
Might sound weird, but I am having a blast right now with JOML. There are a lot of new cool features being added to it, mostly regarding quaternions, while I am trying to hammer that quaternion math into my brain, which is really really hard to grasp! :)

But to hide all that, JOML provides nice interfaces, such as the all-new Quaternion.integrate() function, which allows you to apply angular velocity over a time differential to an existing quaternion in order to make it rotate "more" about a particular vector/axis.

Also new is the nlerp() function to linearly (non-spherically) interpolate rotations between two quaternions.

All this and more is now available in the 1.2.1-SNAPSHOT release

Btw. how are things with the Oculus going along? Could you solve that projection issue?

BrickFarmer

Sounds fun, and I'm looking forward to trying some of that out soon!

I'm away from my windows oculus dev system, so I was just trying out JOML in a new project, with the aim to replace the current math in my Oculus project.  Hopefully that will fix whatever was wrong there and I can get on making something a little more interesting after my travels.  Peter.
Oculus Rift CV1, MBP 2016 - 2.9 i7 - Radeon Pro 460  OSX 10.12.4,  Win7 - i5 4670K - GTX1070.
Oculus Rift VR Experiments: https://github.com/WhiteHexagon

BrickFarmer

From the 'joml-camera' readme I see:

"Free Camera: You can freely look around and move the camera in the scene"

Is that something already implemented? or in progress?  Is it like a first person view?
Oculus Rift CV1, MBP 2016 - 2.9 i7 - Radeon Pro 460  OSX 10.12.4,  Win7 - i5 4670K - GTX1070.
Oculus Rift VR Experiments: https://github.com/WhiteHexagon

Kai

If the person in "first person" is a space ship that can accelerate in all three major axes and rotate around, then yes, it is a first person camera. :)
But it is still in the making.
More generally, I am planning the interface of this camera to:
- provide a possibility to accelerate and decelerate the camera along all three axes
- provide the same for angular acceleration
- allow a client to map WASD/mouse or joystick/pad - or whatever input device it uses - to this interface
- maybe just like the ArcBall camera to just set a destination point/orientation and then let the camera figure out how to get there

But in the long run I want to move away from player-controlled cameras towards more parameterized systems allowing you to have a camera automatically move through your scene along a path specified by keyframes of given positions and orientations, just like the paths you can create in Blender, because I am going to need that for another project.

Kai

So, it's been about nine days since I posted the last update of JOML. There is still much going on in that project and now I begin to realize how much of a gain in (development) efficiency a code generator would have been. :)
But I guess we are out of the woods now and (existing parts of) the API stabilize.
The last changes have been mostly to refine small parts of the existing API, add a lot of new things regarding quaternions and polishing the JavaDocs.

So far the current snapshot release 1.2.5 contains the latest changes.

BrickFarmer

where do you find the time :) well done.  They seem like they will be well suited for working with the Rift when I get back from my travels.
Oculus Rift CV1, MBP 2016 - 2.9 i7 - Radeon Pro 460  OSX 10.12.4,  Win7 - i5 4670K - GTX1070.
Oculus Rift VR Experiments: https://github.com/WhiteHexagon

Kai

I don't travel as much. :D
Nah, actually I am quite fed up with traveling. Travelled the last two and a half years through Germany to customers of our consulting company. Now, I am enjoying my stay in Hamburg for awhile. :)
But thanks. I am glad it is useful for you. Tell me if you find that something is missing or buggy.

Kai

Hey,
the next snapshot release 1.2.6 of JOML is out and it features new methods to compute a reflection matrix!
This was somewhat the last missing piece of the picture to hopefully complete the matrix class.
With this reflect()/reflection() methods, you can build reflection matrices which (for example) allow you to do OpenGL stencil reflections about arbitrary planes!
And just because all demos out there showcasing stencil reflections always somehow use a simple plane (mostly y=0) which is boring, there is now a joml-lwjgl3-demo which can use ANY reflection plane.
Check it out! :)

Kai

Hello JOML users,

the latest 1.3.0 release is out. It contains a whole host of changes (mostly additions), most important of which is the fix to a bug in (set)LookAt and (set)LookAlong in Matrix3 and Matrix4 classes, as well as Quaternion.lookRotate.
People making use of those look-methods are encouraged to switch to the latest release.
Other things include making the double-precision classes more in sync with their single-precision variants.
There is also now a Matrix3/4.normal() computing a normal matrix, which is useful when transforming normals when using shaders when gl_NormalMatrix is not avaiable.