lwjgl

Skybox textures do not display correctly

倾然丶 夕夏残阳落幕 提交于 2020-04-14 07:36:53
问题 I have a problem with skybox textures. If you twist the camera, it creates a feeling that one texture overlays another, as in the screenshot: Skybox show code: private void drawSkybox(int texId){ glColor4f(1,1,1,1); glDepthMask(false); glEnable(GL_TEXTURE_CUBE_MAP); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_CUBE_MAP, texId); glBindVertexArray(vao[0]); glBindBuffer (GL_ARRAY_BUFFER, vbo[0]); glDrawArrays(GL_TRIANGLES, 0, 36); glBindVertexArray(0); glBindBuffer (GL_ARRAY_BUFFER, 0)

Skybox textures do not display correctly

六月ゝ 毕业季﹏ 提交于 2020-04-14 07:36:06
问题 I have a problem with skybox textures. If you twist the camera, it creates a feeling that one texture overlays another, as in the screenshot: Skybox show code: private void drawSkybox(int texId){ glColor4f(1,1,1,1); glDepthMask(false); glEnable(GL_TEXTURE_CUBE_MAP); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_CUBE_MAP, texId); glBindVertexArray(vao[0]); glBindBuffer (GL_ARRAY_BUFFER, vbo[0]); glDrawArrays(GL_TRIANGLES, 0, 36); glBindVertexArray(0); glBindBuffer (GL_ARRAY_BUFFER, 0)

LWJGL Display mounted on Canvas fails to generate Mouse Events

社会主义新天地 提交于 2020-01-25 23:56:13
问题 My ultimate goal is to be able to make use of additional mouse buttons in Java. Currently, LWJGL's JInput doesn't seem capable of detecting more than three buttons. To make use of Java's System.setProperty("sun.awt.enableExtraMouseButtons", "true"), I've tried mounting the Display onto an AWT Canvas, within a JFrame. Unfortunately, this does not appear to work, and I am unsure why. [I should note that I've been away from Java for a some time] import java.awt.Canvas; import java.awt.event

How do you use not-power-of-2 textures in LWJGL?

折月煮酒 提交于 2020-01-25 00:04:50
问题 I'm using Slick Util's Texture class to load textures for lwjgl, but apparently that forces your texture to a power of 2. How would you use a texture that's not a power of 2? (I really don't want to add transparent pixels to the edge of the image to make it a power of 2.) I've seen somewhere that it's possible, but I can't find any way of doing it. 回答1: The reason the stick-utils package forces you to use power-of-two textures is this is what graphics cards like to load. Where possible, you

Java LWJGL: When I call “GL11.glEnd” the polygon disappears?

喜你入骨 提交于 2020-01-24 20:33:07
问题 When I call "GL11.glEnd" the polygon disappears. If I leave that one line "GL11.glEnd" out, then it stays on the screen, but when I put it in, the polygon I was drawing disappears. package package01; import org.lwjgl.opengl.GL11; public class Graph { ... void initGraph(){ GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); GL11.glClearDepth(1.0); GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); GL11.glOrtho(-500, 500, -281, 281, -1, 1); GL11.glColor3f(0.8f, 0.8f, 1.0f); GL11.glBegin

Thread Setup for GLFW

心已入冬 提交于 2020-01-23 09:04:04
问题 I started working with the new Lwjgl 3 which uses GLFW for its Display/mouse/keyboard handling and I'm really liking it! However today i hit a brick. I had a simple rendering animation going but when I dragged the screen it stopped rendering until i let go again. According to: http://www.glfw.org/faq.html The problem arises due to windows. 3.5 - Why does my application freeze when I move or resize the window? The Windows event loop is blocked by certain actions like dragging or resizing a

LWJGL - Problems implementing 'roll' in a 6DOF Camera using quaternions and a translation matrix

狂风中的少年 提交于 2020-01-22 20:37:49
问题 I've spent a couple weeks on this issue and can't seem to find a proper solution and need some advice. I'm working on creating a Camera class using LWJGL/Java, and am using Quaternions to handle bearing (yaw), pitch and roll rotations. I'd like this camera to handle all 6 degrees of movement in 3D space, and roll. Bearing, Pitch and Roll are all quaternions. I multiply them into a 'change' quaternion, and create a translation matrix from that. I put that in a float buffer, and multiply the

Does LWJGL (bare) use software or hardware rendering?

空扰寡人 提交于 2020-01-15 03:43:05
问题 Does the bare LWJGL distribution use hardware rendering or software rendering? 回答1: LWJGL always uses hardware rendering. Since it is a games library, it just quits if no hardware rendering is available. From the LWJGL wiki: "Made the library throw an exception when hardware acceleration is not available on Windows. No point in running at 5fps is there? "(LWJGL wiki) There is a command-line switch org.lwjgl.opengl.Display.allowSoftwareOpenGL but I don't think you can force it to use software

White Pixels With GL_POLYGON_SMOOTH

时光毁灭记忆、已成空白 提交于 2020-01-14 05:21:11
问题 I had a problem where white pixels appeared randomly (sort of) on objects in OpenGL. This is an example of what was going on. While searching Stack Overflow for other people who may have had this problem, I found that GL_POLYGON_SMOOTH wasn't worth enabling. I disabled it, and the spots disappeared (this was lucky of me). This was very lucky, but I still don't understand why enabling GL_POLYGON_SMOOTH creates these artifact-thingies. Can someone explain why they appear? Also note I had

OpenGL 3 (LWJGL) LookAt Matrix Confusion

拥有回忆 提交于 2020-01-10 19:40:11
问题 I'm learning OpenGL 3 using LWJGL. I have tried to implement an equivalent to gluLookAt() , and although it works am I somewhat confused as to why. I confess to just copying this code from various sources on the web, but after much study I think understand the maths behind it, and that I understand what LWJGL is doing. However the 'correct' gluLookAt code behaved incorrectly in my application, as the camera seemed to be turning the wrong way. I only managed to get my code working by