lwjgl

LWJGL not rendering textures correctly?

此生再无相见时 提交于 2019-12-24 10:22:23
问题 I use LWJGL to render everything in my game I am making, and I use it to render backgrounds, which is okay, but when I render things less than the full size of the display, it shows random lines and the image is slanted. Here is a screenshot picture; See the split line about a third of the way across, and the line on the left hand side. http://i.stack.imgur.com/6O9dI.png And here is my code; ImageLoader.STAT_BAR.bind(); GL11.glBegin(GL11.GL_QUADS); GL11.glTexCoord2f(0,0); //TOP LEFT GL11

LWJGL 3D picking

痞子三分冷 提交于 2019-12-24 07:59:29
问题 So I have been trying to understand the concept of 3D picking but as I can't find any video guides nor any concrete guides that actually speak English, it is proving to be very difficult. If anyone is well experienced with 3D picking in LWJGL, could you give me an example with line by line explanation of what everything means. I should mention that all I am trying to do it shoot the ray out of the center of the screen (not where the mouse is) and have it detect just a normal cube (rendered in

Downloading LWJGL natives with Ivy

不羁的心 提交于 2019-12-24 01:37:09
问题 I'm trying to set up an Ant + Ivy build for a personal project. Everything was making sense, and working nicely, until I got to LWJGL. Everything from LWJGL is resolved, except the natives. The Readme.md on their website makes it seem that it is possible to get these through Ivy: LWJGL 3 can be used with Maven/Gradle/Ivy, with the following dependencies: org.lwjgl:lwjgl:${version} org.lwjgl:lwjgl-platform:${version}:natives-windows org.lwjgl:lwjgl-platform:${version}:natives-linux org.lwjgl

LWJGL Projection Matrix - Nothing Happens

て烟熏妆下的殇ゞ 提交于 2019-12-24 01:05:37
问题 Currently, I'm attempting to create a Camera class in LWJGL, but I've been running into a problem with the projection matrix. For some reason, when I try to multiply the vertices by the projection matrix, nothing at all appears on screen. Camera class public class Camera { private Vector3f position, rotation; private Matrix4f view; private final Vector3f xAxis, yAxis, zAxis; private float fov, aspect, zNear, zFar; private Matrix4f projection; public Camera(float fov, float aspect, float zNear

LWJGL Ray Picking (gluUnProject)

谁说胖子不能爱 提交于 2019-12-24 00:47:44
问题 So I have been looking through tutorials (And questions on this site) and have found nothing to solve my problem. Here is the current code I am trying to implement: private void pick() { float[] matModelView = new float[16], matProjView = new float[16]; int[] view = new int[16]; float mouseX = width / 2; float mouseY = height / 2; Vector3f start = new Vector3f(); Vector3f end = new Vector3f(); FloatBuffer modelBuffer = compileBuffer(matModelView); FloatBuffer projBuffer = compileBuffer

glfwGetVideoMode(glfwGetPrimaryMonitor()) not working

≯℡__Kan透↙ 提交于 2019-12-24 00:38:07
问题 So i was watching a tutorial for java on how to create a window using Lwjgl and i got to this part where you get the primary monitor: ByteBuffer vidmode = glfwGetVideoMode(glfwGetPrimaryMonitor()); glfwSetWindowPos( window, (GLFWVidMode.width(vidmode) - width) / 2, (GLFWVidMode.height(vidmode) - height) / 2 ); However i get this error on eclipse : "Type mismatch: cannot convert from GLFWVidMode to ByteBuffer" which results in this not being allowed: GLFWVidMode.width GLFWVidMode.height (it

First person camera weird behaviour on moving the eye

佐手、 提交于 2019-12-24 00:13:49
问题 I am trying to make a game/demo with Java/LWJGL and having troubles with the first person camera: I use the W A S D to move the eye vector around, however strange things are happening: When I move the eye away or to me, the right resp. left parts of the view get blocked for my view. When I move the eye to the right or left of me, then the top resp. bottom parts of the view get blocked for my view. I have implemented mouse movement (to look around) with success, the relevant pieces of code now

OpenCL kernel arguments

半城伤御伤魂 提交于 2019-12-23 22:18:54
问题 I've just started fiddling around with OpenCL and I've come across a problem: I do not know how to pass complex data structures as arguments. I'm using LWJGL's OpenCL binding, and the example provided in the wiki http://lwjgl.org/wiki/index.php?title=Sum_Example. In that example 2 float buffers are created and passed as arguments (LWGJL provides methods in a class named BufferUtils for creating these buffers). Now, how would I create a buffer of points, typedef struct {int x, int y} tpoint ,

OpenGL 3.3 on Mac OSX El Capitan with LWJGL

会有一股神秘感。 提交于 2019-12-23 17:43:29
问题 I am currently trying to create an OpenGL 3.3 context in LWJGL 3 on my Macbook Pro mid 2014. My sourcecode to initialize the window looks like this: if (!glfwInit()) { Logger.addError("GLFW", "init failed"); } glfwDefaultWindowHints(); glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); glfwWindowHint(GLFW_OPENGL_CORE_PROFILE, GL_TRUE); glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); // glfwWindowHint(GLFW_SAMPLES, 2); ID = glfwCreateWindow(width

How can I set an OpenGL display (Window created by OpenGL) to maximized?

◇◆丶佛笑我妖孽 提交于 2019-12-23 13:27:11
问题 I would like to set my OpenGL display to maximised. I can have users do it manually if I setResizeable(true) and then get players to click the maximise button, which as a tester mentioned is a pain and an unnecessary step for users. I can set the display size to the same size as the players' screen, but that just looks odd, and I am not looking for fullscreen mode. Obviously I can fullscreen and set display size already, but I am currently unable to find any method that actually allows me to