OpenGL 3D Game Tutorial 1: The Display
Why Stack Overflow recommends it
Stack Overflow users link it as the tutorial they were following when they hit LWJGL and Eclipse setup errors, and as a reference for modern OpenGL game engine structure in Java.
Recommended by 2 people across 2 different months, 2016 to 2022.
What it is
The first episode of ThinMatrix's LWJGL 2 tutorial series on building a 3D Java game with OpenGL. It covers creating the display window and OpenGL context, with the code posted on GitHub and a companion video on project setup.
What people said
Recommends claudehenry · 2016-02 · Stack Overflow · on “glFrustum() completely unnecessary?”
It depends on what you're doing. It you want to do more advanced openGL (2.0+), you'll need to switch to the programmable pipeline and write your own shaders. while that may seem hard, and it is at first, it pays off with the freedom that that provides. If you decide to work with the programable pipeline, you wont used the fixed pipeline functions, such as glOrtho() or glfrustum() and other immediate mode rendering calls like glBegin(GLenum) and glVertex3f(float, float, float) . Also keep in mind that immediate mode is not compatible with the 3.0+ rendering pipeline. That all being said, that doesn't render immediate completely useless, It's still useful for laying down quick and dirty demos
Recommends PolymorphismPrince · 2018-10 · Stack Overflow · on “Can't import any referenced libraries from build path in eclipse”
I'm trying to work my way through ThinMatrix's Open Gl Java tutorial [this video] . And... I'm stuck on video 1. I also worked through the short precursor video [LINK] where he installed on the dependencies (Including lwjgl 2) in eclipse. Right now I just have the very start of the first class: package renderEngine; import org.lwjgl.opengl.Display; //Error is here import org.lwjgl.opengl.DisplayMode; //And here //Handle the window public class DisplayManager { //Create a display public static void createDisplay() { Display.setDisplayMode(new DisplayMode()); } } I receive the error, "The import org cannot be resolved". Even though I've added the files to the build path config and I've added the na
Cites Zoe - Save the data dump · 2017-05 · Stack Overflow · on “Dynamically add Opengl shapes”
You create an interface or class called Shape . This will contain the data needed to render a 3D shape (vertices, indices, color data, etc). Alternatively the VAO/VBO/texture IDs/other IDs for rendering. The advantage here of using a class is that you can initialize the methods and keep everything in a single class while maintaining the ability to extend it and create more classes (Cube, Pyramid, Model, etc) to customize your objects. Or just use different instances loaded with different data. There's lots of ways to do the same thing here. You can add more data after renderer initialization though, but by storing your data, you can reuse it later. Assuming the raw model data is stored in a
Cites Kareist · 2017-12 · Stack Overflow · on “Error compiling LWJGL example with Java/NetBeans”
I recently looked at these tutorials on LWJGL. I'm trying to compile them in a NetBeans environment. But it gives an error: Cannot find symbol. Location: class Texture; Method: getTexture (); I declare the method as follows: public Texture getTexture () { return texture; } Location of method: class TModel. package mod.els; import mis.ter.pin.Model; import text.ures.Texture; public class TModel { private Model model; private Texture texture; public TModel(Model model, Texture texture) { this.model = model; this.texture = texture; } public Model getRawModel() { return model; } public Texture getTexture() { return texture; } } And class Texture: package text.ures; import java.io.FileInputStream
Cites BRHSM · 2018-11 · Stack Overflow · on “Calculating normals for model lighting results in the model no longer rendering”
I'm working on a simple render engine in java which can render OBJ files to the screen. I'm currently working on the lighting system which is used to light up the models which are present on the screen. Before introducing the lighting system I was able to load models to the screan easely: [LINK] however, when I add the light to the screen the model does no longer show up. I'm using the following shader to render the light: VertexShader: #version 150 in vec3 position; in vec2 textureCoordinates; in vec3 normals; out vec2 passTextureCoordinates; out vec3 surfaceNormal; out vec3 toLightVector; uniform mat4 transformationMatrixTextured; uniform mat4 projectionMatrixTextured; uniform mat4 viewMat
Cites new Q Open Wid · 2022-01 · Stack Overflow · on “Unsatisfied Link Error when trying to use LWJGL 2 with Eclipse”
I'm making a Java application with LWJGL following this tutorial [this video] with Eclipse, Java 15 and LWJGL 2. However, I keep getting this error: Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/zixuan/workspace/GameEngine/lib/natives/liblwjgl64.so: /home/zixuan/.p2/pool/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.linux.x86_64_15.0.2.v20210201-0955/jre/lib/libjawt.so: version `SUNWprivate_1.1' not found (required by /home/zixuan/workspace/GameEngine/lib/natives/liblwjgl64.so) This is my current buildpath organization: [LINK] I also added the native libraries: [LINK] Currently my folders look like this: -GameEngine -src [sourcecode] -bin [bins] -lib -jars -lwjgl.jar -lwjg
Cites user18339230 · 2022-03 · Stack Overflow · on “Eclipse IDE ERROR (Exception in thread "main" java.lang.NoClassDefFoundError: sun/misc/Unsafe)”
I am currently following a game engine tutorial by ThinMatrix, this is the video [this video] , and I keep getting this error: Exception in thread "main" java.lang.NoClassDefFoundError: sun/misc/Unsafe at lwjgl/org.lwjgl.MemoryUtilSun$AccessorUnsafe.getUnsafeInstance(MemoryUtilSun.java:74) at lwjgl/org.lwjgl.MemoryUtilSun$AccessorUnsafe.<init>(MemoryUtilSun.java:62) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at jav