Please login or register.

Login with username, password and session length
Pages: 1 ... 8 9 [10]
 on: March 14, 2017, 08:17:59 
Started by rtmsoft - Last post by rtmsoft
found http://forum.lwjgl.org/index.php?topic=1264.msg8394#msg8394
API GL13.glCompressedTexImage2D is changed.Trying to change parameter such as
Code: [Select]
Code: [Select]
It draws a black area on my lwjgl display,how to do it now?

 on: March 13, 2017, 08:55:03 
Started by guatto - Last post by guatto
I modified my Matrix4f as you told me but now nothing appears, even if I remove the transformation matrix :

Code: [Select]
            matrix.m00 = 2.0f / (right - left);
    matrix.m01 = 0;
    matrix.m02 = 0;
    matrix.m03 = 0;
    matrix.m10 = 0;
    matrix.m11 = 2.0f / (top - bottom);
    matrix.m12 = 0;
    matrix.m13 = 0;
    matrix.m20 = 0;
    matrix.m21 = 0;
    matrix.m22 = -2.0f / (far - near);
    matrix.m23 = 0;
    matrix.m30 = -(right+left)/(right-left);
    matrix.m31 = -(top+bottom)/(top-bottom);
    matrix.m32 = -(far+near)/(far-near);
    matrix.m33 = 1;

I entered the following coordinates for the parameters:

Code: [Select]
  //left      right   bottom    top     near   far
    (0.0f,   800,    600,       0.0f,   0.0f,   1.0f)

 on: March 12, 2017, 23:38:43 
Started by guatto - Last post by Kai
In Matrix4f.mXY the X is the column index!

 on: March 12, 2017, 23:03:40 
Started by guatto - Last post by guatto
I followed the link you gave me and I tried to create an orthographic projection but the result is disappointing, my project contains multiple classes so I uploaded it to a host if you want to help me, thank you !


 on: March 12, 2017, 18:21:09 
Started by guatto - Last post by Kai
Please do read the "Orthographic Projection" section of that article.

 on: March 12, 2017, 18:16:35 
Started by guatto - Last post by guatto
First thank you for your answers, concerning my previous problem it was about the Orthogonal projection that's why I remove it, can you just tell me what formula should I follow, I am still a beginner , thanks again !

 on: March 12, 2017, 17:57:36 
Started by guatto - Last post by Kai
You were already given an answer in your previous post, which you deleted.
The answer was: http://www.songho.ca/opengl/gl_projectionmatrix.html

 on: March 12, 2017, 17:48:11 
Started by guatto - Last post by guatto
let's say that my screen is (800 * 600) and i have a Quad (2D) drawn with the following vertices positions using Triangle_Strip (in NDC) :

Code: [Select]
float[] vertices = {-0.2f,0.2f,-0.2f,-0.2f,0.2f,0.2f,0.2f,-0.2f};
And I set up my Transformation Matrix in this way :

Code: [Select]
Matrix4f tranMatrix = new Matrix4f();
Matrix4f.translate(position, tranMatrix, tranMatrix);
Matrix4f.scale(new Vector3f(size.x, size.y, 1f), tranMatrix, tranMatrix);

And my vertex Shader :

Code: [Select]
#version 150 core
in vec2 in_Position;
uniform mat4 transMatrix;
void main(void) {
    gl_Position = transMatrix * vec4(in_Position,0,1.0);

My question is, which formula should I use to modify the transformations of my quad with coordinates (in Pixels) ?

For example :
-set scale (50px width, 50px height)  => NDC Vector2f(width,height)
-set position (100px posX, 100px posY) => NDC Vector2f(x,y)

To better understand, I would create a function to convert my Pixels data to NDCs to send them next to the shader. Thank you !

 on: March 12, 2017, 13:30:58 
Started by rupy - Last post by rupy
So I'm thinking about building this C++ engine, but I really don't like working in C++/C, so I'm thinking of having the core engine be C++ and then you script the game in Java very similar to Unity. Has anything like this been done before.

Also do you know if there are many other small open source game engines like this one out there:


 on: March 06, 2017, 20:39:24 
Started by pdid - Last post by Gojira
Ah, OK I think I get it.

So most GLFW functions need to be called on the main thread.

But the rendering context I get from `glfwCreateWindow` and `glfwMakeContextCurrent` can be used with OpenGL calls on any thread (assuming proper synchronization and mutex).

Pages: 1 ... 8 9 [10]