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
91 views

Last Matrix operation ignored?

I have 2 methods, one to rotate my Quad and one to flip it (using scaleM), they are as follows: (Note, all values in these methods have been properly defined). If I call just one, they work as ...
1
vote
1answer
172 views

Implementing axonometric bird-view in XNA

I made all kinds of logic (waypath, aso) for my strategical game, based on XNA (monogame). Now I "misused" the Vector2 a little bit: As I'm working from a "top-down" perspective, I'm using the Y-axis ...
1
vote
0answers
135 views

Matrix array doesn't seem to get populated

I'm trying to stream an array of matrices to a vertex shader, but it seems that only the first matrix works. What could be the problem? I suspect that I upload the matrices in a wrong way. C# ...
0
votes
0answers
26 views

Constrain parent node transform to child bounds

If I have some node rendering tree set up, where a node basically has a draw method to render things, and a transform, represented as a 3x3 matrix, with scale and translation. Now, I would like to ...
1
vote
0answers
97 views

Rotate view matrix based on touch coordinates

I'm working on an Android game where I need to rotate the camera around the origin based on the user dragging their finger. My view matrix has initial position of sitting on the negative z and facing ...
0
votes
1answer
191 views

Trying to convert as3 Matrix to C++ glm matrix

I am trying to convert a library called DragonBones to C++ Opengl which allows you to use Flash based skeletal animation. I'm almost done but I am running into a problem. I am trying to transform the ...
1
vote
4answers
145 views

Storing tile grid in a matrix: row major vs column major

I'm using a generic matrix container to store the tile grid for my RTS game. This is where I am confused: a matrix is traditionally row major, i.e. matrix(0, 10) means 'at 0th row, 10th column.' A ...
1
vote
1answer
183 views

How can shears/reflections/enlargements be represented by 4x4 matrices? [closed]

I understand that 4x4 matrices can represent transformations on a 3d point (represented as x, y, z, w) Eg, a translation is [1 0 0 0] [0 1 0 0] [0 0 1 0] [x y z 1] where x, y and z are the amount ...
-1
votes
1answer
182 views

Pinhole matrix problem

I made a program to represent a 3D world. I use the projection matrix we can find on wikipedia. For viewing a scene it's very nice but when I straff in the scene, everything behind the camera go on ...
2
votes
1answer
203 views

XNA matrix order problem

I want a matrix that scales first and then rotates. I tried the code below, but it didn't work. zRotation, yRotation and xRotation are rotations that shouldn't be affected by the origin. allrot should ...
3
votes
1answer
211 views

Shear transformation in the projection matrix?

I am trying to understand what the shear transformation (l+r/r-l & b+t/t-b) is actually doing in the projection matrix? The only thing I got till now is headache :) Can you please help?
1
vote
2answers
340 views

Creating a 2D perspective in 3D game

I'm new to XNA and 3D game development in general. I'm creating a puzzle game kind of similar to tetris, built with blocks. I decided to build the game in 3D since I can do some cool animations and ...
2
votes
1answer
520 views

How to do directional per fragment lighting in world space?

I am attempting to create a GLSL shader for simple, per-fragment directional light. So far, after following many tutorials, I have continually ran into the issue: my light is specified in world ...
4
votes
3answers
304 views

Matrix multiplication - Scene Graphs

I wrote a MatrixStack class in C# to use in a SceneGraph. So, to get the world matrix for an object I am suposed to use: WorldMatrix = ParentWorld * LocalTransform But, in fact, it only works as ...
0
votes
1answer
122 views

Common way to store model transformations

I ask myself what's the best way to store the transformations in a model class. What I came up with is to store the translation and scaling in a Vector3 and the rotation in a Matrix4. On each update ...
1
vote
1answer
118 views

Matrix transforms in XNA

So in my most recent 2D game I draw objects like so. _spriteBatch.Draw(_sprite, Center(), null, Color.White, _rotation, new Vector2(_sprite.Width / 2, _sprite.Height / 2), _scale, ...
0
votes
1answer
666 views

What is the difference between a modelview-projection matrix and world-view-projection matrix?

So basically I wrote a shader a long time ago that uses all World and WVP matrices. Now I am working in an engine that will only give me access to ModelView, MVP, and model to world space matrices. ...
0
votes
2answers
330 views

Is this Rotation Matrix correct?

I'm having heavly troubles with setting up a View Matrix and a Projection Matrix. It simply doesnt work. So I think my problem is related to my rotationMatrix function. I'm using this tutorial to ...
2
votes
1answer
139 views

Manual GLU.gluUnproject

Before I used GLU.gluUnproject to calculate my picking ray in my OpenGL game. Recently I switched to my own calculated matrices, and now I can forget the gluUnproject. How can I calculate the picking ...
2
votes
1answer
171 views

Optimising skeletal animation

I am implementing a skeleton system for my latest game. I am using my own linear algebra classes which already have some optimisations, such as separate transformPoint and transformVector functions ...
3
votes
2answers
4k views

OpenGL - Understanding the relationship between Model, View and World Matrix

I am having a bit of trouble understanding how these matrixes work and how to set them up in relation to one another to get a proper system running. In my understanding the Model Matrix is the matrix ...
2
votes
1answer
160 views

OpenGL Calculate Matrices

Im trying to switch from the glTranslate etc to my own Matrices, but for some reason it does not work. Here are my 2 functions to create the view- and projection matrix: public Matrix4f ...
0
votes
1answer
229 views

Sharp DX Identity Matrix, Matrix.Forward vector pointing at negative Z

I'm trying to take a steady grip on Sharp DX. Already done some work like translating, scaling and rotating objects. Now i have to calculate the rotation matrix using only direction vector and ...
0
votes
1answer
88 views

What values to construct “Projection Matrix” from?

I am curious to what standard values I should use to create a camera's projection matrix, as well as if certain measurements need to be taken if I want to represent a very small world or a very big ...
0
votes
1answer
120 views

Getting Rotation Values From A Rotation Matrix

I'm trying to get rotation values along the x, y and z axis from a matrix that can include rotation, translation and scale data. Currently I have this function to return the y rotational value: float ...
3
votes
1answer
494 views

Rotating and Translating a Node in Horde3D with Matrices and Quaternions

I have been trying to learn how to use the Horde3D rendering engine for the past couple of days, and so far I have managed to learn a decent amount and integrate Bullet Physics with it as well. My ...
0
votes
1answer
127 views

XNA Camera Positioning All Wrong

I've been working in 3DSMax for years now and decided to give XNA 4.0 a try. I've got the majority of it working, however the camera is being a pain to me and I can't discern what's gone wrong. I ...
3
votes
2answers
169 views

What kind of projection is ScreenX=X/Z, ScreenY=Y/Z?

I have an existing class which transforms 3D vectors and projects them on a 2D plane (Camera). The code is all written in C without help from an external library. To project a single vector (X,Y,Z) ...
2
votes
1answer
364 views

Negative scale in Matrix 4x4

After some rotations and to from quaternion conversions I get negative scale from Matrix 4x4, is it possible? I need that scale to draw sprite on screen so I get sprite flipped, how to deal with this ...
2
votes
2answers
243 views

Java Tetris - Matrix Rotations

I'm building Tetris in Java and am trying to use linear algebra to rotate a piece composed of 4 tiles. My friend was explaining the way to do it is: He said: "To clarify, you do need to rotate ...
4
votes
3answers
1k views

Tetris - Rotations using Linear Algebra (Rotation Matrices)

I'm making Tetris in Java and am at the point of rotations... Originally I was hardcoding each rotation: if (direction.equals("right")) { if (shape.equals("Bar")) { if ...
2
votes
1answer
200 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 ...
0
votes
2answers
114 views

Transform translation relative to world space

What is common algorithm for translating a transform matrix relative to world space axis? E.g. Matrix M is representing some local space. When I want to translate M relative to it's own local axis, I ...
2
votes
1answer
187 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", ...
2
votes
1answer
127 views

transformations of matrices

I'm in the process of reading up on 3d matrices and trying to following this powerpoint and had a few questions as to how to exactly determine the type of transformation from a matrix. If I have a ...
0
votes
1answer
216 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
273 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 ...
1
vote
0answers
104 views

Rotate Points with Object in world space

I posted this in the original stack overflow then realized that a game-dev specific one exists. I am working on personal project that requires me to have 4 points surrounding an object (1 at each of ...
2
votes
2answers
520 views

World space and model space the dummies version [closed]

I'm by no means a 3d programmer but have recently taken it upon myself to build a Voxel based game and I'm having a little trouble understanding some of the concepts around matrices (what with my ...
5
votes
1answer
407 views

Rotating plane to be parallel to given normal via change of basis

I have two planes and their respective normals. I would like to rotate the second plane, planeB, so that it is parallel to the first, planeA. To do this, I am using a change of basis to rotate each ...
1
vote
2answers
231 views

Accumulating rotations for camera

It seems there are three ways to store a camera's rotation: in angles, view matrix or quaternion. I was using euler angles since when I used a matrix it had a tendency to accumulate rounding errors ...
1
vote
1answer
161 views

Proper approach to handle transformation matrix and extract its components

Basically I have a Transformation component object with following structure(pseudo): TransformComponent{ Vec3 position; Vec3 rotation; //in euler angles Vec3 scale; Mat4 worldMatrix; ...
0
votes
1answer
276 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 ...
2
votes
1answer
386 views

How can I create a 2D camera with upscaling and translation?

I've computed a Viewport that is fair in size (a proper aspect ratio to the given device) and then I calculate my ScaleMatrix like so: scaleMatrix = Matrix.CreateScale( (float) ...
1
vote
2answers
3k views

What matrix operations do I perform to translate then rotate then translate then rotate?

In an android game I want to draw a running leg. To output the thigh I do something like: // legCX,legCY is the location on screen about which the leg rotates. Matrix m = new Matrix(); ...
5
votes
3answers
2k views

Mapping 3D object coordinates to 2D screen coordinates with perspective projection

Sort of following on from where this person was in their topic: Matrix for 2D perspective What I have at the moment is a transformation matrix that's defined as follows: http://pastebin.com/GM6BhP0R ...
7
votes
2answers
1k views

How can you extract orientation from a transformation matrix?

I have a 4x4 transformation matrix M, and I want to find out the shape of a sphere when transformed by M. (Sphere is at the origin and has radius 1.) I know I can find the center by just multiplying ...
0
votes
1answer
62 views

Assigning bone transform in every draw a good idea?

In my Draw method, I am doing the following: thisMesh.CopyAbsoluteBoneTransformsTo(transforms); Is this a good idea? Or should I do this once at the constructor level?
1
vote
1answer
445 views

2D Matrix Transformation (with a Player and Ground)

I have a simple game that I'm trying to do for learning purposes, but Matrices are a bit hard, especially in DirectX. I currently have a tilesystem that renders tiles at the screen and a character ...
0
votes
1answer
796 views

All of my matrix functions not working? OpenGL ES 2.0

I am trying to make a projection matrix scaling the screen and making a coordination system. For some reason I don't think any of my matrix calling is working... the 3 function I am using are ...