An array of numbers, symbols or expressions, arranged in row and columns. The numbers, symbols or expressions themselves are called elements or entries.

learn more… | top users | synonyms (1)

0
votes
1answer
17 views

Java OpenGL Perspective matrix not working

I'm trying to render a simple triangle with OpenGL in Java using LWJGL3. Everything is working great, but the projection matrix (perspective) is not working. In C++ I just used to apply the ...
0
votes
0answers
27 views

Basic example of using matrices in graphics? [on hold]

I learned some basic matrix 101 stuff. I used the matrix to solve a system of equations. Can anyone point me to an article or video that shows a very basic example of how a matrix operation is used ...
0
votes
0answers
12 views

2D viewport matrix World to Local coordinates

I would like to use a Matrix but it causes (or I think it does) problems with accuracy. Clearly classic float matrix causes jaggy movement/accuracy issues. The reason is that my objects have real ...
0
votes
0answers
9 views

change position/orientation of a bone using assimp

I have been using assimp to import rigged models and animations. I followed this tutorial for skeletal animation and I have got it done properly. The part that I am trying to do now is to orient a ...
0
votes
0answers
19 views

Coordinate system in OGLdev tutorials

Working with OGLdev tutorials http://ogldev.atspace.co.uk/ I found that this code uses coordinate system, which doesn't look like in most other samples. Positive x-axis direction is left, and not ...
0
votes
1answer
32 views

Matrix Rotation Only Works On one Axis At A Time

I have this function in my vertex shader. It makes a transformation matix out of a transformation matrix, a rotation and an intensity. It works just fine when setting the rotation of one of the axis ...
1
vote
1answer
54 views

Pre-calculating skeletal animation data

I'm working on skeletal animation and so far I've got the skeleton drawn with interpolated animation working (just on the cpu still). I was thinking about changing my file format for my skeleton and ...
11
votes
3answers
252 views

Rotate object around fixed axis

I am trying to let the user of my app rotate a 3D object drawn in the center of the screen by dragging their finger on screen. A horizontal movement on screen means rotation around a fixed Y axis, and ...
0
votes
0answers
48 views

Pre- or post-multiplication for rotation between coordinate frames

I have three 3D coordinate frames: O, A and B, as shown below. I want to know the rotation matrix RAB between A and B, that is the rotation that is required, with respect to the frame A, to move ...
0
votes
1answer
33 views

Inline-Building a World (SRT) Matrix

Currently, to construct a world matrix, I have the following code: return FromScale(scale) * rotation.RotMatrix * FromTranslation(translation); However, this is constructing three matrices, and ...
4
votes
3answers
255 views

Why do we refer to a “model view” matrix and not a “viewprojection” matrix?

Why there is a model-view matrix, but not a view-projection matrix? A view-projection matrix would make much more sense to me, since every entity in the scene has his own position and therefore its ...
0
votes
1answer
36 views

Rotate heading relative to agent's local space

I'm having a little trouble translating a point in my game's world space to an object's local space. I have a cannon in my game with a normalized heading vector that's always supposed to point in the ...
2
votes
1answer
117 views

Project rotated matrix to isometric coordinate

I have a group of soldiers, and each has a vector describing their position in the squad. When the group rotates, I do this math to calculate the desired position of each soldier. var unitPositions : ...
0
votes
0answers
15 views

Use Android 4x5 ColorMatrix in OpenGL ES 2 Shader

I am trying to use Android Color Matrix in OpenGL ES 2. I have been able to use a 4x4 Matrix using the following code in the Shader (this adds also an intensity parameter): varying vec2 ...
0
votes
0answers
32 views

GLSL billboarding

I want to make billboarding using GLSL. For what I've got so far it works, but not exactly the way I want. My vertex shader looks like this: #version 120 uniform float partSize; varying vec2 ...
0
votes
1answer
56 views

libgdx - Box2d debug draw not correct

I have a problem where the bodies in my debug draw does not draw correctly, take a look: As you can see, there is some space between the dynamic body and the ground. I have checked the contact ...
0
votes
0answers
42 views

Matrix, vector multiplications in OpenTK

I developed a 3d model viewer in c++ with OpenGL, and in c# in OpenTK. Both are using the same shader, but the output from OpenTK is not correct. I read that OpenTK is row major order, and OpenGL is ...
0
votes
1answer
35 views

Binding an Instance Matrix with an InputLayout

If I want to bind an instance matrix to a vertex shader, how do I go about it? For example, here is a super-simple VS input: struct VS_IN { float4 Position : POSITION; row_major float4x4 ...
1
vote
1answer
92 views

How to position a Weapons model in a first person shooter with XNA

I am building a first person shooter and positioning the weapons is hard. I am trying to get the bat to look like you are holding it but I keep trying things and they don't appear in the positions I ...
0
votes
1answer
65 views

Scaling world - projection, view or separate matrix?

I am currently writing a simple 3D space visualisation program. Things get loaded into it from a simple XML file, which contains positions and sizes of objects in space, so you can put basically any ...
3
votes
1answer
102 views

what is the very last element of a 4x4 transformation matrix for? [duplicate]

while its a similar value to its neighbour - Z translation (and I wont say if thats above or to the left for fear of sparking a religious war!) and it only seems to change when the Z translation value ...
3
votes
1answer
88 views

What is FOVx in this diagram?

a beginner game developer here. I have recently taken upon learning about 3D game development and I am stuck on a simple matrix problem. The image is found from this article: ...
0
votes
0answers
26 views

Connecting a model's joint to the joint of another model

I am trying to figure out the math behind orientating and translating a model so that a specified point on the model will connect with a specified point on another model. For example, given the ...
0
votes
0answers
318 views

Implement Camera (former: CCCamera) v2 in cocos2d-x v3.3

we want to port camera code from cocos2d-x version 2 to version 3.3 with the goal to imitate the behaviour of a CCCamera in cocos2d-x version 2 exactly. You can assume that values for "eye" and "up" ...
2
votes
1answer
214 views

OpenGL light appears to move with camera and changes with object rotation

I have a working open gl es 2.0 3d engine (my own) that I've used in several iOS apps. I recently noticed that on a mutli-symmetrical object the lighting didn't look the same at each rotation. For ...
8
votes
3answers
795 views

How can I reverse the effect of a transformation matrix?

I have recently been working on a game with using OpenGL and C++ through GLFW. In the game I have an airship with a turret mounted on it. The airship moves around in world space coordinates and the ...
0
votes
1answer
85 views

Transformations and basis vectors

I've been reading this very nice tutorial on OpenGL, and I encountered a statement which I can't wrap my head around. In Chapter 6, it states: Transformation from one space to another ultimately ...
0
votes
1answer
48 views

Problematic cameraposition (Eye = (0,0,0), at=(0,-2,0) and up = (0,1,0))?

I am taking a course in computergraphics and we talk a lot about OpenGL and the math you need to do everything OpenGL does "by hand". A Question which was asked in an old exam (I am preparing at the ...
1
vote
3answers
168 views

2D HLSL World position

I'm trying to get world position from my vertex shader to my pixel shader so that I can disable the shader once a preset X coordinate has been passed (no shading once I'm over X). Getting the screen ...
0
votes
1answer
83 views

Directional lights (not) rotating with camera (opposite problem)

I am trying to implement a shader for directional lights correctly, but I am bit confused as to why it works when it shouldn't and vice versa. People usually encounter problem with lights changing ...
0
votes
0answers
52 views

Relative Transformations for Bones

I'm using Blender to export my armatures in relative coordinates, and I'm trying to get to absolute coordinates in my engine. For the above example, the childBone's tip is an offset of [-1,0,0], ...
2
votes
2answers
66 views

What is the meaning of the row “opposite” the translation column?

Usually, I do my matrix multiplication like this: [1 0 0 dx] | [px] [px + dx] [0 1 0 dy] | [py] [py + dy] [0 0 1 dz] | [pz] = [pz + dz] [A B C 1] | [1] [1] Where the translation is along ...
1
vote
1answer
65 views

How to fix model matrices colliding in vertex shader?

I am new to OpenGL programming and I'm writing some basic code to display a few objects onto a screen. I have a pyramid shape that I'm displaying, as well as a box shape that I am displaying. The ...
5
votes
1answer
144 views

Why bother with a separate normal matrix, if there is never non-uniform scaling on the view matrix?

I am updating one of my shaders to a version of OpenGL/GLSL that doesn't automatically provide gl_NormalMatrix (for educational purposes; I'm not ripping out working code for the sake of it). ...
0
votes
0answers
23 views

Transform screenquad around object's view space boundaries (GLSL)

Im not sure how to ask this, but essentially I am looking for a way to optimize rendering screen quad lights per object. I have a deferred renderer that draws directional lights onto a screen quad. ...
0
votes
1answer
41 views

trasformation matrix for model's bones

I was developing an fbx converter for legend of grimrock object model (www.grimrock.net), I just wanted to get the animations cause the rest has been converted by others' tools. I was reading all of ...
0
votes
2answers
211 views

c# Unity - Matrix output incorrect on vector rotation

I have a input Vector (1,1,0) when I run it through a Unity Matrix4x4 class with a rotation of 90 degrees around the Z axis the output is (-0.9999999,1,0) which is nearly correct but strange. But ...
0
votes
0answers
72 views

XNA C# - Get original rotation from parent bone transform

I have a 3DS Max made model, exported into FBX and imported into XNA project. The parts I am working with have NOT been rotated in Max (specifically, collision mesh is made of Axiz-Aligned boxes). ...
0
votes
0answers
55 views

3d Rotation problem

I was given an interesting (but tough) problem to solve: In a game, you want to change the heading of an enemy by +30°. Construct a Rotation Matrix, Euler Angles and a Quaternion that would do this. ...
2
votes
1answer
64 views

XNA: How do I match Spritebatch View/Projection Matrices with BasicEffect Matrices?

I'm rendering a bunch of 2D content using SpriteBatches to a default XNA viewport. A simple 2D camera is used to move around the scene, which generates a transformation matrix passed to each ...
0
votes
1answer
95 views

How can I get a 4x4 matrix from a bullet quaternion?

I'm trying to make a game using JavaScript with Ammo.js ( an implementation of bullet ) and Sylvester to do my matrix maths. The problem is I don't know how to turn the WXYZ that bullet gives into the ...
0
votes
0answers
68 views

Apply android.graphics.Matrix transformation to an Open GL ES shader

I am currently using a 4x4 matrix to convert from "pixel" coordinates to OpenGL ones, my scene is full screen so my screen matrix looks like this: 2f / width, 0f, 0f, 0f, 0f, -2f / height, 0f, 0f, ...
-1
votes
1answer
68 views

MVP Matrix * Vector3 = Black Screen? [closed]

I'm relatively new to computer graphics so please take it easy. I created a ModelViewProjection Matrix and I sent it to my shader: #version 330 core layout(location = 0)in vec3 vert; uniform mat4 ...
2
votes
1answer
107 views

What AI algorithm to use to find hidden shapes in a Battleships-like game

I'm developing a game similar to Battleships, only using different shapes. A single type of shape will be used within a game session, by both the human player and AI. There will be several objects ...
2
votes
1answer
66 views

Distort a quad with a World Matrix

Is it possible to distort a quad multiplying its vertices by a specific world matrix? See the picture to understand what kind of distortion I need: Please note, that the quad is in 3d space and I ...
0
votes
1answer
119 views

New to OpenGL , having trouble understanding matrix transformation

I have modest experience of developing games with sdl , libgdx , unity etc. But never got into learning any low level API. So I thought about learning OpenGL and got started with tutorials provided by ...
2
votes
1answer
101 views

From 3d rotation, snap to nearest 90 directions

I have a 4x4 transformation matrix, made only from successive rotations and translations, and I'd like to "snap" my object to the "nearest" of the 24 orthogonal (multiples of 90 degree) rotations. ...
1
vote
1answer
173 views

What is the correct multiplication order for a 2D matrix?

I'm currently trying to create a camera and entity/model matrix for my 2D game similar to that of Unity3D. I've already tried to find answers to this question on stackoverflow/gamedev but i couldn't ...
4
votes
1answer
60 views

How can I find the minimal texture size so the texture requires no pixel interpolation when transformed by a given matrix?

Given a rectangle with width x and height y, and a transformation matrix T: How can I estimate the minimal resolution of the texture (that is, its width and height) such the interpolation of ...
2
votes
1answer
67 views

Orthogonal projections question

I'm very VERY new into the game development world and I had just some slight trouble wrapping my head around something. We were told between classes just to think about how scaling matrices can ...