Tagged Questions
2
votes
1answer
60 views
Translating Viewmatrix is inverted, why?
So I've defined a Projectionmatrix, Viewmatrix and a Modelmatrix using OpenGL (LWJGL).
But when I translate my Viewmatrix to +X it moves my object to the right (hence my camera is moving to the ...
1
vote
0answers
75 views
Box2D, OpenGL, resolution and matrix setup
Okay, my internal units are going to be meters, ranging between 0.1 and 10 meters for size.
First of all, my mind is all wrapped up in a knot trying to understand how to handle my game with multiple ...
2
votes
1answer
85 views
Camera not strafing (GLSL)
I use this code in my GLSL vertex shader, where v_position is the vertex position:
gl_Position = v_position * u_camera;
and set u_camera as follows:
meshShader.setUniformMatrix("u_camera",
...
0
votes
1answer
51 views
Box2D OpenGL debug renderer convert box2d coordinates to world space
I made an OpenGL 3.x renderer for Box2D's debug draw (b2Draw base class). Unfortunately I've tried for a while now to convert the box2D units, which are meters to my internal units which are pixels. I ...
-1
votes
3answers
104 views
Directional light and matrix issues
I'm trying to implement basic directional lightning in OpenGL 3.3 by emulating the logic shown in this guide: http://www.arcsynthesis.org/gltut/Illumination/Tutorial%2009.html
I do not understand ...
0
votes
1answer
61 views
Ways to “invert Z-axis” in shader-based core-profile OpenGL?
In my hobbyist shader-based (non-FFP) GL (3.2+ core) "engine", everything in world-space and model-space is by design "left-handed" (and to stay that way), so X-axis goes from -1 ("left") to 1 ...
0
votes
1answer
113 views
Y Axis inverted on vertex output
I've got my project running and somehow it seems my vertex y components are inverted. 10 in the positive on Y goes down and 10 negative on the Y axis goes up.
I can't find anything with the ...
2
votes
2answers
221 views
How should I organize my matrices in a 3D game engine?
I'm working with a group of people from around the world to create a game engine (and hopefully a game with it) within the next upcoming years. My first task is to write a camera class for the engine ...
6
votes
4answers
341 views
How can I generate a view or projection matrix for OpenGL 3.+
I'm transitioning from OpenGL 2 to OpenGL 3.+ and to GLSL 1.5. I'm trying to avoid using the deprecated features.
My question how do we now generate the view or projection matrix. I was using the ...
2
votes
2answers
309 views
The purpose of using invert and transpose
In openGl ES and the World of 3D - why use the invers matrix?
The thing is that I dont have any intuition to, why it is used, therefore please correct me:
As fare as I understand, it is used in ...
1
vote
0answers
141 views
How do I convert my matrix from OpenGL to Marmalade?
I am using a third party rendering API, Marmalade, on top of OpenGL code and I cannot get my matrices correct. One of the API's authors states this:
We're right handed by default, and we treat y ...
2
votes
1answer
2k views
How does gluLookAt work?
From my understanding,
gluLookAt(
eye_x, eye_y, eye_z,
center_x, center_y, center_z,
up_x, up_y, up_z
);
is equivalent to:
glRotatef(B, 0.0, 0.0, 1.0);
...
43
votes
8answers
5k views
Why do we move the world instead of the camera?
I heard that in an OpenGL game what we do to let the player move is not to move the camera but to move the whole world around.
For example here is an extract of this tutorial: OpenGL View matrix
...
0
votes
2answers
441 views
OpenGL, objects disappear at a certain z distance
I'm writing a managed OpenGL library in C++, and I'm having a pretty annoying problem. Whenever I set an objects Z coordinate to -2.0 or lower, the object disappears. And at coordinates 0 through ...
0
votes
1answer
241 views
Correct Rotation and Translation with a 4x4 matrix
I am using a 4x4 matrix to transform verts in a shader. I multiply an identity matrix by a rotation matrix by a translation matrix. I am trying to first rotate the verts and then translate them, ...
0
votes
2answers
754 views
OpenGL matrix vs DirectX matrix
I'm working on an animation and model exporter from Maya to use within my game. Currently, models work perfectly, and animations have some issues with the joints. Since Maya works in an OpenGL ...
-2
votes
1answer
166 views
Why doesn't my MatrixStack class work? [closed]
I've been trying to get openGLES2 to work on my Android device and this is starting to drive me insane. I've spent well over ten hours now trying to get this to work. I just don't understand anymore. ...
2
votes
1answer
297 views
Finding a suitable axis-angle to avoid gimbal lock
In OpenGL the camera faces the -z axis with the +y axis pointing up. I am using quaternions to represent the orientation of my objects (which works well) and am trying to do the same for the camera. I ...
4
votes
1answer
490 views
Multiplication for MVP matrices: Any benefits to doing so within the vertex shader?
I'd like to understand under what circumstances (if any) it is worth doing MVP matrix multiplication inside a vertex shader.
The vertex shader is run once per vertex, and a single mesh typically ...
0
votes
1answer
603 views
Trouble with Collada bones
I have a Collada file with a rigged mesh. I've read the node tags in the library_visual_scenes tag and extracted the matrix for each node and stored everything in a hierarchical bone structure. My ...
4
votes
2answers
803 views
Should the modelview and projection matrices be calculated in the shader or on the CPU?
At minimum I would have a camera with rotation and world position; projections parameters such as angle of view and perspective vs. orthographic; and meshes with scale, angle, and world position.
...
2
votes
1answer
129 views
Rotation going wrong
I'm calculating matrices by hand. Translations are fine:
void Translate (float x, float y, float z, float[4][4] m) {
Identity (m);
m[3][0] = x;
m[3][1] = y;
m[3][2] = z;
}
If ...
0
votes
1answer
128 views
Calculate vertex coordinates
Newbie here!
I need to know the effective coordinates of a triangle after applying transformations (rotations & translations) to the current (MODELVIEW) matrix.
That is, given a vertex P, I ...
4
votes
1answer
221 views
Translation from one coordinate system to another having Z-offset issues
I'm using ARToolkit to do an augmented reality application, but my problem is really with the 3D coordinates.
In this application, I use my webcam to generate the scene. I have two markers (printed ...
3
votes
1answer
1k views
Bones Animation - Matrices and calculations
We are 'on final' when it comes to finishing the project, but just before implementing the animation system.
Our Client decided to choose "Bones Animation" - which is that I should export each ...
5
votes
1answer
779 views
Problem with Assimp 3D model loader
In my game I have model loading functions for Assimp model loading library. I can load the model and render it, but the model displays incorrectly. The models load in as if they were using a seperate ...
2
votes
2answers
362 views
3D Translation using only distance and angles
So I'm starting to foray into 3D game programming, but I've hit something of a snag.
I have an object I want to move around. It should always move either forward or backward relative to its local Z ...
0
votes
3answers
224 views
Project rendering onto a polygon in the scene
I have a function that renders a simple OpenGL scene. I want to display this scene on a polygon within another scene, without the function having to know about it. For example, to display the scene on ...
1
vote
1answer
575 views
Translating local to global coordinates in ARToolkit / OpenGL
Ok, so I've tried reading over the other questions and something's just not clicking for me. I am working on an augmented reality application using ARToolkit, however it should just be straight ...
0
votes
1answer
889 views
matrix 4x4 position data
I understand that a 4x4 matrix holds rotation and position data.
The rotation data is held in the 3x3 sub-matrix at the top left of the matrix.
The position data is held in the last column of the ...