A 2D array of numbers, symbols or expressions, arranged in rows and columns. Each row must have the same number of columns. The numbers, symbols or expressions themselves are called elements or entries.

learn more… | top users | synonyms (1)

0
votes
2answers
30 views

How much to roll Z to make horizon level

I've got a flying camera with some arbitrary rotation. (It also has a translation, but that's not important.) It's flying along its local Z axis, traveling in some direction over the ground with ...
0
votes
1answer
22 views

How to transform a matrix's local space position into another's local space

When looking at an example to learn how to do per pixel collision, I came across this: // Calculate a matrix which transforms from A's local space into // world space and then into B's local space ...
0
votes
1answer
52 views

Why would this scaling matrix have no effect?

To draw a simple model using the DirectXTk, I'm doing the following. It all works perfectly, draws correct, and so on. Except changing the scaling factor makes NO difference, and I can't figure out ...
0
votes
1answer
16 views

Using glm to rotate the modelview matrix based on the cursor position

I am rendering a 3D model of an object, and I want the user to be able to rotate around that object by dragging the mouse. To do this, I want to use the cursor position to continually update the ...
0
votes
1answer
24 views

THREE.JS: why is the rotation only applied on the last axis used?

my function: function rotateAroundWorldAxis2(object, radians1, radians2) { object.rotWorldMatrix.makeRotationX(radians1).makeRotationZ(radians2); // object.rotWorldMatrix; ...
0
votes
1answer
86 views

XNA 2D rotation Matrix offset/origin

I'm currently struggling with finding the offset for my original camera translation after I have applied a rotation for it. transform = Matrix.CreateScale(new Vector3(1, 0.75f, 1)) ...
0
votes
0answers
28 views

Rotation matrix is being inconsistent with pitch and roll

I'm calculating the rotation matrix for a turret when it's at an angle in Javascript. I have XYZ co-ords for the turret and target with X being 90 degrees right, Y being straight ahead and Z being ...
0
votes
1answer
44 views

opengl matrix multiplication

Can someone provide some type of example of multiplying a 4x4 matrix without using loops? typedef struct matrix4 { data[16]; } m4; can someone provide a sample of how you you'd multiply two of ...
0
votes
1answer
45 views

Camera (pole cam) implementation problem

In my project I have simple scene graph to render whole scene and Bullet physics SDK to provide physics simulation. Each rendered object is represented as scene node. Camera always has target and ...
4
votes
1answer
120 views

Does converting quaternion to matrix cause a lot of overhead?

This is related to rendering creating a model, view, projection matrix for opengl. While matrix are fairly standard there's a lot of talk about using quaternions for rotations but why would u go from ...
2
votes
1answer
44 views

How to calculate if a point is contained in rectangular camera viewport with rotation?

I am working with my camera, and am trying to improve it so that I can calculate if a world point is on screen, taking rotation into account. Currently, my camera rectangle is calculated as so: ...
0
votes
0answers
21 views

When use LookAt or Inverted world matrix to compute View Matrix?

I am reading this article http://www.3dgep.com/understanding-the-view-matrix/ and it says that View Matrix is the inverted matrix of World (or Model) Matrix but in the first approach the article ...
9
votes
2answers
795 views

Why do we need a fourth coordinate to divide by z?

I read the response here: What does the graphics card do with the fourth element of a vector as the final position? "The fourth component is a trick to keep track of perspective projection. ...
0
votes
1answer
45 views

How to understand kind of matrix/world from implemented math operations?

i'm a newbie in 3d programming, and i approach for the first time this argument. I try to make some changes to an existing 3d object viewer, to better suite my needs. This object viewer is jsc3d. I ...
1
vote
1answer
32 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
89 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
39 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
41 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
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
59 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
61 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
61 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
77 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
78 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
90 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
83 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
54 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
95 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
28 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
61 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
58 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
41 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
113 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
747 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
88 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
42 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
336 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
59 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
199 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
33 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
49 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
184 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
97 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
72 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
112 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
80 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
127 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
113 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
31 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
976 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" ...