An array of numbers, symbols or expressions, arranged in row and columns. The numbers, symbols or expressions themselves are called elements or entries.
0
votes
1answer
42 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
28 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
39 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
87 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 ...
0
votes
1answer
17 views
Flash: matrix transformation combined with non-uniform screen scaling
I'm using a Flash transformation matrix (http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/geom/Matrix.html) to do affine transformation.
I have a rectangular image that's ...
0
votes
1answer
21 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
43 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
54 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
35 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
38 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
75 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
44 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
129 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
397 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
217 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
135 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
126 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
1answer
110 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
85 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
35 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
70 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
250 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
55 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
87 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
101 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
83 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
79 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
27 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
80 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
125 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
67 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
102 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
76 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 ...
14
votes
4answers
1k 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
83 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
27 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
213 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
112 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 ...
0
votes
0answers
108 views
Alter a model-view-projection matrix
I have a model-view-projection matrix created based upon my camera. Is it possible to make alterations to it after it was computed to affect the corners of the resulting camera frustrum? For example, ...
0
votes
1answer
331 views
Screen space decals, converting world to decal space
I'm trying to do screen space deferred decals following the presentation made by Pope Kim about SSDs in WH40K: Space Marine (link). I've gotten to the point where I can render a decal if the bounding ...
0
votes
0answers
57 views
“Blinking” graphical bug when rotating shadow matrix
So, we have implemented Krypton shadows into our code for our 2D game, and it's working beautifully. Only issue is that we're running into a bizarre graphical bug when rotating the shadows with the ...
6
votes
0answers
204 views
Rotation pitch/yaw reverse problems when picking a tile (2.5D) [closed]
Set-up: 3D world, isometric sprite rendering (4 fixed angles).
This transform matrix is used as camera:
_transform =
Matrix.CreateRotationZ(Roll) *
...
2
votes
1answer
124 views
Finding out the “width” and “height” of my screen after projection added
In a 2d game, doing collisions with the edges of your screen is easy. Your textures are a 1:1 mapping of your screen resolution because your verities are too.. if your x position is > than ( screen ...
0
votes
3answers
140 views
How can I properly rotate a 2D vector in the “flipped” XNA client space?
In my 2d XNA game, because SpriteBatch treats world space as client space and has positive Y axis down and negative up, I've built my game's world space with that coordinate system too. However, I've ...
0
votes
1answer
231 views
XNA 2D Camera, zoom into player
My 2D camera follows the character fine without any zooming. However, when I tried adding a zoom feature using the Matrix.CreateScale(), the camera no longer follows the character properly.
public ...
2
votes
2answers
185 views
Why translation uses multiplication and not addition? [closed]
To translate an object from (x, y, z) to (a + x, b + y, c + z) it's done using:
OK, that's cool, but why would we multiply in the first place when we can add the two matrices directly as:
...
0
votes
1answer
82 views
How can I adjust the UVs of my quad so my texture isn't flipped?
My sprite geometry is reversed using matrix so that it is in the XZ plane. This results in the image used for the sprite to also be reversed, which I don't want:
(source : ...
2
votes
1answer
90 views
Light Space and Light Texture Space in shaders
I'm looking into material translucency and I'm working through some GPU Gems documentation (http://http.developer.nvidia.com/GPUGems/gpugems_ch16.html).
In Example 16-4 it references matrices for ...
14
votes
4answers
1k views
What does a matrix represent?
I began learning OpenGL recently and am having problems visualizing what matrices are and their role in computer graphics. Given the template of a 4x4 matrix like this:
I would assume that each ...