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)

1
vote
1answer
24 views

16-byte aligned matrix in DirectX9 and D3DX with Havok Physics 2012

I want to ask a question about D3DXMATRIX and D3DXMATRIXA16, and how to use them with Havok Physics. I'm using Visual Studio 2012 on Windows 8. I successfully created an instance of hkpWorld, added ...
6
votes
1answer
79 views

How can I keep the clicked point under the mouse when rotating? (GLM)

I have a spherical mesh of radius 1, centered at (0,0,0) in world coordinates. I want to rotate the sphere so that the clicked point remains under the mouse at all times. However, I cannot find an ...
1
vote
1answer
36 views

Rotate an objects velocity

I have a collision system (in 3D but for the purpose of the question assume 2D) where I want to calculate the new velocity (stored as a vector) after a collision. What I have is the velocity of the ...
0
votes
0answers
21 views

Adding a 2D transformation matrix to GLSL

I'm having trouble understanding the matrices I need to render an object in OpenGL. I've been using a matrix to make up for the translation and scaling from the camera in my game but I didn't have a ...
0
votes
0answers
19 views

Determine local “roll” from matrix

I'm allowing my player to maneuver freely in three dimensions. The world is very cubical, so it is useful to know internally (to help hint controls) which ground plane they're closest to paralleling. ...
0
votes
0answers
35 views

Coordinates estimation

Hi im using artoolkit to extract the coordinates of the marker im detecting with the camera. I need to know the values returned when arGetTransMat is the coordinates (x,y,z) which is returned ...
0
votes
0answers
42 views

OpenGL - Cubemap “Rotating” Proportional To Camera Movement

I'm doing a simple planet rendering project and am running into an issue with accessing cubemap textures correctly. The planet terrain is generated using the diamond square algorithm done 6 times and ...
0
votes
3answers
59 views

Problems Animating Texture in OpenGL

I'm trying to animate a texture to scroll a static screen for a television, however I'm having some issues. Just translating within the texture matrix animates all textures in the scene which is ...
0
votes
0answers
59 views

OpenGL model transforms wrong on AMD GPU

I've been writing a program that uses OpenGL to display some simple 3D models (rays, cuboids, spheres and simple meshes). I am targeting the programmable pipeline in OpenGL 3.2. So far I have been ...
1
vote
2answers
60 views

How can I calculate the orthographic projection needed to encompass an object with arbitrary rotation?

So I need to set up the dimensions of a orthographic projection that will encompass the entirety of a bounding box when viewed from any arbitrary position. That's an eye (programmer art); and the ...
0
votes
1answer
59 views

how to stop camera at the end of world map when zoomed in

Im building a tile-based game, and Im trying to implement zooming in on the center of the screen. My problem is, when I get to the edge of the map and im zoomed in, Im noticing that my camera doesn't ...
1
vote
2answers
80 views

OpenGL: Is it efficient ok to glPushMatrix, plMultMatrix, plPopMatrix for every object in my scene?

I'm very new to opengl, and I might not fully understand the openGL matrix projection stack thing. So, I have about 300 'objects' in my scene, each with their own position/rotation, and I want to ...
0
votes
2answers
77 views

Problems with Rotation Matrices on Certain Axes

Here is what my rotation matrix looks like: public Matrix4f initRotation(float x, float y, float z) { Matrix4f rx = new Matrix4f(); Matrix4f ry = new Matrix4f(); Matrix4f rz = new ...
1
vote
0answers
47 views

Confused About My Code Suggesting The Normal Matrix Is Equivalent To The ModelView Matrix

I'm learning environment mapping in OpenGL by following this page. In his vertex shader, the author calculates the vertex normal in eye space with the following code: nEye = vec3(viewMatrix * ...
0
votes
1answer
64 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
25 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
39 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
42 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
39 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
103 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 ...
12
votes
3answers
535 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
75 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
35 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
293 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
51 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
179 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
29 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
41 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
130 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
82 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
58 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
104 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
76 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
110 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
99 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
30 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
754 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
467 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
928 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
94 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 ...
1
vote
2answers
68 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
203 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
114 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
64 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
89 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
80 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
186 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
26 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
47 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
312 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 ...