Tag Info

New answers tagged

1

You should read the Javadocs for Slicks TrueTypeFont. It has a Method public int getWidth(java.lang.String whatchars) to get the width of a particular String. To draw perfectly centered it is then simply int positionX = (windowWidth - textWidth) / 2;


0

Don't know if still relevant, just wanted to update you that I had the very same issue and this fixed it: (this is not my answer, all credits go to adventurerOK @ http://stackoverflow.com/questions/10064804/java-lwjgl-slick-unicodefont-acting-up) It seems I have this error now, it will only draw the outlined rectangle before using the font. This seems ...


1

The glGenVertexArrays() interface was added to OpenGL core contexts in version 3.0, the same version in which immediate mode rendering was removed from OpenGL (although it had long since been deprecated, 3.0 is where it finally absolutely went away) So you are correct. If immediate mode drawing works, then you are using an OpenGL context old enough that ...


1

for (int i = 0; i < vertices.length / 3; i++) { vertexList[indices[i]] = new Vector3f(vertices[i], vertices[i + 1], vertices[i + 2]); } In your first run, you're taking vertices[0], vertices[1] and vertices[2], in your second run you're taking vertices[1], vertices[2] and vertices[3], see where the problem is? And i don't get why you're using ...


0

First, this question is about asking for a tutorial, and as far as i know googling "opengl tutorial" is enough to get you started. Second, i don't recommend you to use such an old version of opengl, even if you want to support an extremely large range of computers, the 'modern opengl' (a.k.a. Opengl 3.0+) is widely supperted as well. And imho learning opengl ...


0

I don't think you should be instancing individual blocks. That's a lot of data you have to send back and forth to the GPU... it just isn't feasible, especially for a voxel engine. I would construct a mesh from the chunk data and place it into a VBO. Every time there is a chunk update, discard the mesh and create a new one in it's place. I feel that the ...


3

The way you are rendering voxels is extremely ineffective. For each cube you have to do calculations, set uniforms, and worst of all bind textures(This is usually a very expensive operation) Typically effective voxel rendering involves multiple techniques to speed up rendering: Rendering in chunks: You split your world into neatly sized proportions, which ...


1

One possible solution would be to actually curve the terrain model. If your game/physics engine wouldn't support this while the character (I assume there is a character) is on the ground, then you could have two models, one with curvature and one without, which you could switch between based on some sort of altitude threshold (supposedly the curvature of the ...


-1

I would not recommend this! Games are games and GUIs are GUIs. Just because they're not console applications does not mean that they're equivalent. I'd HIGHLY recommend something like the Lightweight Java Game Library (LWJGL) http://www.lwjgl.org/ You may not have many problems with Swing (though I think of many off the bat) but if you want to learn how to ...


1

Swing should be fine for your needs. You should check out this stackexchange for other possible problems with Swing.



Top 50 recent answers are included