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

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 ...
2
votes
1answer
37 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 ...
0
votes
1answer
23 views

Offset a camera/render without changing perspective

I need to offset a render so that the perspective / vanishing point doesn't change. Or another way to look at it is that I need to adjust the vanishing point in my view so that instead of being at ...
0
votes
1answer
103 views

How do I rotate and flip 2D sprites stored in a 1D array of pixels?

I am using a 1D array of pixels for rendering in 2D in java. I am interested in rotation (in radians) and mirroring across the x and y axes. The desired result looks something like this: Public void ...
1
vote
1answer
14 views

Camera world matrix to view matrix

I've been working on a game engine and I model every object in my scene graph as an "entity" this includes my camera. My camera therefore has a position and rotation in world space and at the moment ...
0
votes
1answer
42 views

XNA: Camera's Rotation and Translation matrices seem to interfere with each other

I've been following the guide here for how to create a custom 2D camera in XNA. It works great, I've implemented it before, but for some reason, the matrix math is throwing me off. public sealed ...
0
votes
1answer
45 views

Doing a turntable camera animation on a world matrix rather than view matrix

I have a camera class that contains a 4x4 view matrix as a member variable. Most of my camera controls work fine when doing them directly on the view matrix. In an attempt to unify all of my scene ...
4
votes
2answers
164 views

How can I manually construct a right-handed orthographic projection matrix?

I need the formula to create a orthographic projection matrix. I am using GLM math libary and DirectX11. The reason I cannot use GLM to create it is because the NDC spaces are different between DX11 ...
0
votes
1answer
80 views

Find world matrix

I'm making my first 3D-game with XNA (MonoGame) and have come to a point where I wish to add a crosshair for the player. To do this I need the on-screen coordinates of the location where my fighter ...
0
votes
2answers
105 views

Quaternion rotation, translation, scale or 4x3/4x4 matrices for Skeletons?

I'm modding a game that uses 4x3 and 4x4 matrices to make skeletons, but I saw that an skeleton can also be made with a quaternian rotation and vector translation and scaling. What's the difference ...
2
votes
1answer
104 views

What types of matrices are needed for game and graphics programming?

I am writing a 3D math library for general game development and want to know what type of Matrix classes I should include. Is just a 4x4 matrix enough, or must I provide 3x4 and dedicated rotational ...
0
votes
1answer
62 views

How are 2D transformation matrices applied to their targets?

I understand mathematically how transformation matrices work, in that a transformation matrix multiplied by a vector results in a new vector, and we use the matrices for rotation, translation, etc. I ...
0
votes
1answer
54 views

how to retain the animated position in opengl es 2.0

I am doing frame based animation for 300 frames in opengl es 2.0 I want a rectangle to translate by +200 pixels in X axis and also scaled up by double (2 units) in the first 100 frames Then, the ...
0
votes
1answer
57 views

Blender animation to XNA distortion bug

I followed the instructions on the following video: http://www.youtube.com/watch?v=SissgQ0IXvk I'm using XNA 4.0 and Blender 2.69 I export the model with animation to a .FBX file. The animation is ...
3
votes
2answers
118 views

GLM/OpenGL: How Can I Prevent Vector Magnitude From Increasing While Rotating Bones in Skeletal Rig?

ANSWER AT THE BOTTOM OF THIS QUESTION I have been reading tutorials, articles, questions on StackExchange and books all with the subject of skeletal rigging. I have boiled my program down to just the ...
1
vote
1answer
34 views

How do I combine matrix transformation with non-uniform screen scaling in Flash?

I'm using a Flash transformation matrix for affine transformation. I have a rectangular image being rotated and scaled (in 2D). There are two sets of scaling variables, ScreenScaleX and ScreenScaleY, ...
0
votes
1answer
39 views

Get 3D quad rotation matrix from points

I have 4 3D points which represent a even quad in space. (So 3 points are sufficient) I need to get all the individual transformations (translation, rotation, dimensions) so that I can build that quad ...
1
vote
1answer
50 views

Matrix transformation

I have to find components of a matrix for 3D transformation. I have a first system in which transformations are made by multiplying: M1 = Scale x Rotation x Translation. I want to have the same ...
-3
votes
1answer
57 views

projection and matrices [closed]

Many games do just fine with two projections, that can be represented by a matrix (orthographic and linear perspective). But what about projections that can't be represented by a matrix? Can you ...
0
votes
1answer
63 views

XNA 3D cube rotation problem

I am new to game programming and still trying to clear up my basics. I am stuck with a problem and unable to resolve on my own knowledge. I am trying to rotate a 3d cube in MonoGame (Similar to XNA) ...
1
vote
1answer
41 views

How can I transform a Point2f with a matrix on Android?

I'm developing for Android and I'm using the android.renderscript.Matrix3f class to do some calculations. What I need to do now is to now is to do something like mat.tranform(pointIn, pointOut); So ...
1
vote
1answer
125 views

How do I create a camera?

I am trying to create a generic camera class for a game engine, which works for different types of cameras (Orbital, GDoF, FPS), but I have no idea how to go about it. I have read about quaternions ...
1
vote
1answer
54 views

projection / view matrix: the object is bigger than it should and depth does not affect vertices [closed]

I'm currently trying to write a C 3D software rendering engine from scratch just for fun and to have an insight on what OpenGL does behind the scene and what 90's programmers had to do on DOS. I have ...
1
vote
1answer
326 views

OpenGL - Calculating camera view matrix

Problem I am calculating the model, view and projection matrices independently to be used in my shader as follows: gl_Position = projection * view * model * vec4(in_Position, 1.0); When I try to ...
4
votes
3answers
418 views

How to rotate a set of points on z = 0 plane in 3-D, preserving pairwise distances?

I have a set of points double n[] on the plane z = 0. And I have another set of points double[] m on the plane ax + by + cz + d = 0. Length of n is equal to length of m. Also, euclidean distance ...
1
vote
2answers
298 views

Drawing cube in SharpDX, wrong perspective

I want to draw a cube. This is what i currently have: As you can see, the perspective is VERY wrong. The the size in the z-direction is too small and the difference between the front and back size ...
3
votes
1answer
152 views

How to achieve cavalier projection using OpenGL fixed pipeline?

I want to make a quick demo program showing a cube, or a user loaded model, rotating in screen rendered with one of three projections: perspective, isometric and cavalier. Using the fixed pipeline, ...
3
votes
3answers
180 views

How do I disassemble a 3x3 transformation matrix into rotation and scaling matrices?

I have a transformation matrix that rotates and scales. Is there any easy way to disassemble it into the original rotation and scaling matrices? For instance: M = R * S; // I need f and h such that ...
1
vote
2answers
211 views

Matrix rotation wrong orientation LibGDX

I'm having a problem with matrix rotation in libgdx. I rotate it using the method matrix.rotate(Vector3 axis, float angle) but the rotation happens in the model orientation and I need it happens in ...
2
votes
1answer
115 views

How do I check why is no output on screen?

I'm using OpenGL 3.3+, and I'm trying to create an orthographic projection to draw on screen. I have the model data in a buffer: X Y 0, 0 50, 100 100, 0 And I create my Model-View-Projection ...
0
votes
1answer
39 views

Scaling/Rotating triangle

I have a Triangle class and a list of triangles representing my 3D model shape. When I update the position, the rotation or the scale of my model, I also want my triangles list to be updated. I ...
3
votes
1answer
100 views

What are the performance and size tradeoffs of Eigen::Transform versus Eigen::Matrix4f?

We finished migrating from DirectXMath to the Eigen math libraries for our 3D-Game Engine last week for portability reasons. After implementing transformations with matrices as we know them, we found ...
0
votes
2answers
413 views

GLSL: can i use matrix transformation functions in vertex shader?

I have a working OpenGL code where i render a terrain with some trees. I am doing all the matrix mathematics on the client side. Because of which the frame rate of my app is very low, around 25-30 ...
1
vote
2answers
57 views

Copying rotation between matrices

I have a transformed Matrix A and an another transformed Matrix B. How can I COPY the rotation of Matrix B to Matrix A?
2
votes
1answer
95 views

Issues with 2D Body/Limb system [closed]

In my game I have programmed Body and Limb classes. The Body is guaranteed to have an origin in the center of its sprite. The Body class has a List of children Limbs, each with their own offset. Every ...
1
vote
1answer
133 views

How to rotate vertices of 2D shape using a transform matrix?

I am making a top-down 2D game and am currently working on implementing improved collision using SAT. I programmed a Shape class with a Vector2 center that is its position in world space. On top of ...
2
votes
2answers
98 views

Frustum culling based on MVP matrix?

Tutorials on the internet usually say to extract plane data from MVP (model view projection) matrix (or VP?) and then test the bouding volume against each of the frustum planes. I've thought of a ...
0
votes
2answers
103 views

What dimensions should you use for a perspective projection frustum?

What dimensions should you use for a perspective projection frustum? Initially I created a perspective matrix based on the width and height of the screen, with a calculated zNear value based on a ...
0
votes
0answers
28 views

XNA - Link between Create Rotations matrices

A friend of mine have been coding some rotations on my XNA project, but the order of the matrices rotation are not good. Some are of form : Matrix.CreateRotationZ(1.21f) * ...
2
votes
2answers
94 views

How to use camera transformation without depending on (1,-1) scale during spriteBatch.draw()

I am creating a 2D platformer type game in XNA. I currently have a camera object, with a position/rotation/zoomlevel that I use to generate a transformation matrix to pass to SpriteBatch.Begin(). ...
0
votes
3answers
136 views

OpenGL: glRotatef cause performance drop while rotating -x and -y

I have made a rotating cube and I got some performance drops while using two glRotatef calls. So basically this code is giving me 80FPS: //code 1 GLrotate_x += 0.4f; GLrotate_y += 0.4f; ...
0
votes
0answers
69 views

Matrix Translate Camera has some sort of spiky movement

public class Camera2D { private Vector2 _position; protected float _viewportHeight; protected float _viewportWidth; public Vector2 ScreenCenter; protected Being _unit; // the sprite camera is ...
1
vote
1answer
130 views

The correct way to transform a ray with a matrix?

Playing with XNA Triangle Picking Sample I found out that it does not work well if you scale the world matrix of the objects you want to pick. When I dug into the implementation I found this comment ...
0
votes
1answer
86 views

Distorted LookAt When Looking Up or Down?

I have a weird problem and I have no idea what's going on with it. Recently started doing some OpenGL programming, going pretty well, hit some rough spots but worked my way through them and otherwise ...
15
votes
4answers
2k views

Why do we use 4x4 matrices to transform things in 3D?

To translate a vector by 10 unit in the X direction, why do we have to use a matrix? We can just add 10 to the mat[0][0], and we got the same result too.
0
votes
0answers
31 views

Checking if a object is blocking my view of a light (it's between light and camera)

I'm trying to determine, from a list of objects, which ones are blocking my view of a light. In other words: which ones are between the light and the camera. Coding in C++, using HPL1Engine. This is ...
0
votes
1answer
95 views

Relative Position/Rotation calculation

I have 2 objects each with a 3x3 Matrix (Orientation) and a Vector3 (Translation). Both are relative to world coordinates. How do I calculate the position and orientation of object B in relation to ...
2
votes
2answers
31 views

Derive direction in which a spot light emites its light from a projection matrix

First of all, sorry if my question sounds too basic or even makes no sense. I'm new with game development I'm working with HPL1Engine, specifically, the lights parts. I need to know the direction in ...
0
votes
1answer
273 views

First person camera world matrix issue (in THREE.js and webGL)

I'm trying to create a Portal-like effect in webGL using THREE.js. I have two scenes connected by a pair of portals. The view of the 2nd scene in rendered inside the 1st portal using stencils and ...
1
vote
0answers
152 views

How should matrix-based Parallax Scrolling work?

The question is at the end, as it requires a bit of context. I'm not sure if my understanding, my code, or LibGDX's ParallaxCamera is wrong. LibGDX's ParallaxCamera uses Matrix4s to achieve a ...