An array of numbers, symbols or expressions, arranged in row and columns. The numbers, symbols or expressions themselves are called elements or entries.
1
vote
1answer
45 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
60 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
61 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 ...
0
votes
1answer
122 views
Camera lookAt target changes when rotating parent node
have the following issue.I have a camera with lookAt method which works fine.I have a parent node to which I parent the camera.If I rotate the parent node while keeping the camera lookAt the target , ...
1
vote
1answer
337 views
importing animations in Blender, weird rotations/locations
This is for the Blender 2.6 API.
There are two problems:
1. When I import a single animation frame from my animation file to Blender, all bones look fine.
But when I import multiple (all of the ...
2
votes
1answer
40 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
85 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 ...
4
votes
1answer
285 views
apply non-hierarchial transforms to hierarchial skeleton?
I use Blender3D, but the answer might not API-exclusive.
I have some matrices I need to assign to PoseBones. The resulting pose looks fine when there is no bone hierarchy (parenting) and messed up ...
3
votes
1answer
245 views
Retrieving model position after applying modeltransforms in XNA
For this method that the goingBeyond XNA tutorial provides, it would be really convenient if I could retrieve the new position of the model after I apply all the transforms to the mesh. I have edited ...
3
votes
1answer
215 views
D3DXMatrixDecompose gives different quaternion than D3DXQuaternionRotationMatrix
In trying to solve this problem, I tracked down the problem to the conversion of the rotation matrix to quaternion. In particular, consider the following matrix:
-0.02099178 0.9997436 -0.008475631 0
...
2
votes
1answer
76 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
2answers
108 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 ...
0
votes
0answers
32 views
Best way to fit an camera inside a cube [closed]
I've been trying for a few days to create a perspective Camera that will always be axis aligned, can zoom in and out, and will scroll left and right, but should never extend past the bounds of the ...
43
votes
9answers
6k views
Why do we move the world instead of the camera?
I heard that in an OpenGL game what we do to let the player move is not to move the camera but to move the whole world around.
For example here is an extract of this tutorial: OpenGL View matrix
...
0
votes
1answer
40 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
161 views
Stage3D: Camera pans the whole screen
I am trying to create a 2D Stage3D game where you can move the camera around the level in an RTS style. I thought about using Orthographic Matrix3D functions for this but when I try to scroll the ...
0
votes
1answer
49 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
78 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 ...
2
votes
1answer
75 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
65 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
125 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
122 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
114 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 ...
3
votes
3answers
292 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 ...
5
votes
1answer
109 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 ...
2
votes
1answer
64 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 ...
2
votes
1answer
166 views
Scaling along an arbitrary axis (Dealing with non-uniform scale)
I'm trying to build my own little engine to get more familiar with the concepts of 3D programming.
I have a transform class that on each frame it creates a Scaling Matrix (S), a Rotation Matrix from ...
0
votes
2answers
53 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 ...
0
votes
3answers
370 views
Xna Equivalent of Viewport.Unproject in a draw call as a matrix transformation
I am making a 2D sidescroller and I would like to draw my sprite to world space instead of client space so I do not have to lock it to the center of the screen and when the camera stops the sprite ...
1
vote
0answers
81 views
Box2D, OpenGL, resolution and matrix setup
Okay, my internal units are going to be meters, ranging between 0.1 and 10 meters for size.
First of all, my mind is all wrapped up in a knot trying to understand how to handle my game with multiple ...
2
votes
1answer
98 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
88 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
72 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 ...
2
votes
1answer
206 views
Movement on the X an Z axis are combined?
This is probably a stupid question, but I'm trying to simply move a 3D object up, down, left, and right (Not forward or backward).
The Y axis works fine, but when I increment the object's X position, ...
-1
votes
3answers
118 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 ...
7
votes
3answers
1k views
How do I adjust the origin of rotation for a group of sprites?
I am currently grouping sprites together, then applying a rotation transformation on draw:
private void UpdateMatrix(ref Vector2 origin, float radians)
{
Vector3 matrixorigin = new ...
1
vote
0answers
66 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
168 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 ...
3
votes
1answer
156 views
How attach a model with another model on a specific bone?
I meet a difficulty attached to a model to another model on a "bone" accurate.
I searched several forums but no result. I saw that many people have asked the same question but no real result see no ...
1
vote
2answers
115 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 ...
2
votes
1answer
305 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
1answer
106 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; ...
8
votes
4answers
1k views
Staggered Isometric Map: Calculate map coordinates for point on screen
I know there are already a lot of resources about this, but I haven't found one that matches my coordinate system and I'm having massive trouble adjusting any of those solutions to my needs.
What I ...
0
votes
1answer
71 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 ...
0
votes
0answers
52 views
Proper matrix rotation and storing rotation values
I have GameObject's transform component(position+rotation) and shape mesh(array of vertices).
On each game tick I update coordinates of vertices relatively to game object's rotation.
And my current ...
1
vote
2answers
371 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();
...
4
votes
3answers
622 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
...
2
votes
1answer
3k views
Transform between two 3d cartesian coordinate systems
I'd like to know how to get the rotation matrix for the transformation from one cartesian coordinate system (X,Y,Z) to another one (X',Y',Z'). Both systems are defined with three orthogonal vectors as ...
3
votes
1answer
115 views
Extract derived 3D scaling from a 3D Sprite to set to a 2D billboard
I am trying to get the derived position and scaling of a 3D Sprite and set them to a 2D Sprite.
I have managed to do the first part like this:
var p:Point = sprite3d.local3DToGlobal(new ...
6
votes
2answers
358 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 ...


