Can GLM be used in Java? OpenGL LWJGL

Hey I’ve been trying to get some Multi-Texturing to work for my own Game Engine and I’m following this:[NOTE]http://3dgep.com/?p=1116[/NOTE]
Yes it’s in C++ and i’m doing mine in Java, however the use of “glm::<command>” has be deterred as:

  1. I have no idea what those commands do in the background, so I have no idea how to replicate that.
  2. I have no access to any glm::commands (and i’m sure anything that has a “::” is a C++ only operator)

So question(s) is:
-Can I use glm features in Java (if so how? Download and import, simple import that is in OpenGL already?)
-If glm features are C++ (or any C related OpenGL) then what do these commands do?
–glm::normalize( m_NormalBuffer[i] );
–glm::saturate( glm::dot( m_NormalBuffer[i], UP ) - 0.1f );

I’ve been stuck on this problem for way to long and would like to move onto other parts of the engine, and I’m really new to OpenGL so all this is a bit much to take in all at once and understand
(not a new programmer, just new to OpenGL and even the Java Code)

PS:
If my coded is needed to be posted I’ll do so. Some of it is commented and other parts are not.

GLM is a C++ library. If you want to use a C++ library in Java, you’re going to have to write some interface from the C++ library to Java.

GLM is a vector/matrix math library that (to the extent possible in C++) follows the syntax of the OpenGL shading language GLSL. You can not use GLM from Java since it is a C++ library, but I’m sure there are vector/matrix libraries for use with OpenGL for Java - unfortunately I’m not very familiar with the library landscape for Java so can not recommend one. You can look at the GLSL reference pages or the GLSL spec for the meaning of specific functions.

Ah thank you, I had a suspension that it was C++ only, but didn’t want to fully assume

And that reference link is really helpful saddly it lacks saturate but I can kinda guess what it does since i’s using glm::dot

Thanks guys

I’m new to OpenGL, so this might be bad information, but I’m also using it from Java (JOGL) and have been wondering about vector/matrix libraries too. I have seen that the android libraries have a Matrix class (developer.android.com/reference/android/opengl/Matrix.html) and some GLutilities classes for camera view and such, so I was thinking I might import that library even for desktop usage. I can’t see any specific vertex utilities there for dot/cross product, etc., but this link might be helpful: code.google.com/p/android-gl/source/browse/trunk/AndroidGL/src/edu/union/MatrixUtils.java

(Can’t post as links for some reason, maybe because I am new to the forums?)