Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [matrix]

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.

1
vote
2answers
70 views

most compact way to represent dice face translations rolling in cardinal directions

I'm making a 2-D dice rolling game in BASIC (think mechanics similar to Devil Dice on the Playstation, but top-down 2D graphics). I'm trying to accurately represent the transitions of a die when ...
6
votes
3answers
3k 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: ...
4
votes
2answers
949 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 ...
4
votes
1answer
752 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, ...
0
votes
1answer
25 views

Unity Graphics.DrawMesh lags behind rotation?

I have a setup in unity using Graphics.DrawMesh() to draw a mesh on my players camera location in the update loop, ...
1
vote
1answer
182 views

Vertex Skinning, Bone matrices question

I'm creating a model/animation viewer in C# using OpenTK for a game's models. Before stating my problem I want to describe a bit what I've accomplished so far in case I'm fundamentally missing ...
0
votes
0answers
18 views

Drawing ortho outline of rotated elipsoid

I'm working on a collision system for a 2.5D game, and I'm stuck on the sphereoids. As long as scaling x=y=z, and it doesn't rotate, I can just use an r^2 check, but I'm trying to figure out a way to ...
0
votes
0answers
23 views

btRigidBody world transform and scale issue

When I create a collision shape for rigid body (in this case box) I use vertices positions and scale from the opengl matrix, the code looks this way: ...
1
vote
1answer
416 views

Convert a transformation matrix from world-space to camera-space using Eigen

I have a transformation matrix, in world space. I need to convert it to local(camera) space. I have done the reverse of this (Local - to - world) using: ...
6
votes
2answers
2k 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 ...
1
vote
0answers
27 views

Convert bones by bone matrix

I have a 3d-models from old game. They have the following structure: ...
0
votes
1answer
55 views

Camera rotation is weird when it's a child of another object

I implemented scene graph hierarchy into my 3D game engine, and there seems to be a problem with the camera's rotation when it is a child of another object. It only happens with the camera, not any ...
-1
votes
0answers
39 views

2:1 Diametric Projection in 2D

I'm trying to implement a 2D isometric game, well diametric with a 2:1 pixel ratio. Trouble is the rotation matrix I made doesn't seem to work. It's off by a little bit and doesn't line up: I'm not ...
0
votes
0answers
16 views

creating rotation matrix in a left handed coordinate system from a direction vector

I have been looking at creating rotation matrices from a direction vector in the OpenCV coordinate space and there is one thing that has me slightly confused. Here is an OpenCV rotation matrix, that I ...
0
votes
1answer
62 views

Combine rotation XZ (horizontal) with YZ (vertical). Math formula

I'm trying to make a rotation vertically and horizontally around a point at the same time but I'm not able to combine both. I have this formula for the horizontal rotation: ...
4
votes
2answers
232 views

Prevent tile layout gaps

I'm making a map viewer where you can specify where tiles go in a map and then see it on the screen, translate it, and zoom in and out. Here's a picture showing the tiles used to make my example map ...
1
vote
0answers
24 views

Blender - Exporting and Replicating Bone Animation

I'm having trouble replicating Blender bone animation in my game. Bones that have a vertical rest position (Euler(PI / 2, 0, 0)) are animated correctly (e.g. head, neck, torso, legs, shins), however ...
1
vote
2answers
48 views

How to access coordinates of objects in bullet physics (libGDX)?

I need to access the x, y and z coordinates of a bullet physics object. I'm assuming this is done via the transform matrix, but I have no idea which values mean what. There doesn't seem to be any ...
1
vote
2answers
106 views

Is clipping done before or after projection?

Is clipping applied after projection or before? How can it be applied after projection when a vertex is behind the camera and projected therefore mirrored? At this time I clip the triangle before ...
0
votes
1answer
26 views

Determine view-matrix with camera placed in a scene graph

My scene is organized with a simple scene graph where the child multiplies its transformation with the one of the parent. For normal objects, likes meshes, this works as expected, but I also want to ...
1
vote
0answers
28 views

Does it make sense for a view matrix to have a scale?

When building a view matrix from an SRT matrix multiply, examples (here and here) only ever compose it with a R and T. Does it make sense to have the S component be anything other than the identity? ...
1
vote
0answers
417 views

Matrix.CreateBillboard centre rotation problem

I'm having an issue with Matrix.CreateBillboard and a textured Quad where the center axis seems to be positioned incorrectly to ...
17
votes
5answers
8k 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 ...
0
votes
1answer
21 views

Display object at different position

Id' like to create impression of shaking holographic image of NPC in Unity 2018, but moving it with transform will cause unnecesary transform-rigidbody syncing, and using Rigodbody.position isn't an ...
0
votes
0answers
24 views

Billboarding Labels Using Quaternions

I am encountering some issues with billboarding. Although my situation is a bit complicated. So, I am modeling the solar system, and I am also placing labels on everything. For an example, I'll use ...
1
vote
1answer
112 views

Mathematics: matrix-to-quaternion conversion in left-hand coordinate system

I am implementing a typical skeletal animation system, and it requires the usage of quaternion to interpolate rotations between each poses. The asset I import only has a transform matrix for each ...
0
votes
2answers
1k views

How to properly translate a point by a matrix?

I wrote a simple Matrix class and it has methods like rotate, translate, etc. They all seem to be working, but whenever I try to translate a rectangle using the matrix, the translation axis seem to be ...
1
vote
1answer
215 views

How do Axis-Aligned Bounding Boxes update with rotations?

I have a bounding box class with a min (x,y,z) and max point (x,y,z). The object that is being rotated has a rotation matrix (3x3 matrix), but I don't know how to update the bounding box with ...
0
votes
0answers
23 views

Tetris like rotation with a list of points

I have a list of points that I want to rotate around the origin by 90, 180 or 270 degrees. This list can be an arbitrary shape such as: ...
1
vote
3answers
77 views

Rotation of a matrix with unequal rows and columns

I have this simple matrix class which has a char** array for storing the data. The data array gets initialized like this: ...
0
votes
1answer
78 views

Sun model matrix

I'm playing with sun implementation in my engine and I correctly built model matrix using below order of matrix operations: Translate to camera position. Calculate x and y axis of rotation matrix ...
0
votes
1answer
130 views

OpenGL vector rotation matrix to a given point

I have a sphere with a radius of .5 The sphere is centred at 0,0,0 I am now trying to place items around my sphere based on a given x,y,z on the surface of the sphere. My items have been draw/...
0
votes
2answers
47 views

How to keep an object in a certain part of the camera view?

I have a 3d camera that is viewing a character that is moving. As the character is moving i want the camera to adjust itself so as to keep the character in the left third of the camera view. I ...
0
votes
0answers
39 views

Pseudo 3d roguelike: map representation [duplicate]

I know it's a very common question, so I'll try to be specific. I'm working on a pseudo 3d (like Dwarf Fortress or Cataclysm: Dark Days Ahead) roguelike. How you'd represent a map in a roguelike? Let'...
1
vote
1answer
99 views

Why does a translation matrix need extra row?

Following recommendation of this answer I've recently read the series of articles of Wolfire about linear algebra. I'm somewhat familiar with matrices and I came to a conclusion that vector and a ...
1
vote
1answer
86 views

Camera movement issue with pitch and yaw angles

I'm trying to implement a simple first person camera using pitch and yaw angles (no quaternions, I want a simple camera for debugging purposes). An Input class processes mouse input and translate the ...
0
votes
0answers
27 views

anything wrong with a spherical camera view matrix?

Is there anything inherently wrong, if you derive your view matrix from 2 spherical coordinates (say, phi and theta) on the unit sphere? The z-axis vector would be at, say (phi, theta), the y-axis at (...
1
vote
0answers
35 views

OpenAL listener position for isometric camera

I have an isometric camera for an RTS that looks like this: Basically, I don't know how to set the listener's position in OpenAL because I represent the camera's position with only two coordinates. ...
0
votes
1answer
64 views

LibGDX trying to create a matrix of circles

I am trying to create a circular stage like so: But I can only make a square:
1
vote
0answers
161 views

ANSI C (C11) math libraries? [closed]

I know there are a multitude of C++ math libraries out there, but my current project is C-only (C11). So far I've made due with writing my own matrix/vector functions, but now I need to do the more ...
-1
votes
1answer
31 views

How do i rotate my view on its own center

PROBLEM I am trying to translate and rotate my view, the translation works fine but when rotating the rotation is happening on the center of the world(0,0,0) instead of the view position. EXAMPLE ...
1
vote
1answer
27 views

How can I have more values in array on X axis than Y axis in my tilemap?

Following my old question Array of map data renders the map the opposite way after I got the answer to it and fixed my problem, I got another problem that occurs. If my ...
4
votes
1answer
85 views

Camera rotation deforms objects

I'm working on a ray-tracer in C++ with an adjustable camera for a university assignment. I'm entirely new with graphics and I'm struggling with one thing. I have a matrix as a mat4 object (4x4 ...
1
vote
1answer
597 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 <...
1
vote
1answer
39 views

Texture does not fit the screen

Hi guys I am really new in OpenGL-ES and I am developing a simple android application with NDK, and I just want to ask why the image is not fit after I set the width and height of it. this is my <...
0
votes
0answers
45 views

FreeGLUT - Making Planets Orbit at their own Speed

I'm currently working on a project for Uni using FreeGLUT to make a simple solar system simulation. I've got to the point where I've implemented all the planets and have used a Scene Graph to link ...
0
votes
0answers
39 views

Skinning - Bone Matrices Clarification

I'm trying to create the simplest animation scenario, 12 vertices and 2 bones. Both bones has a 4x4 matrix. When both are set to "Identity", the model looks correct, like in the picture above (...
1
vote
2answers
146 views

Drawing & transforming matrices upwards

I'm drawing a hierarchy of 3D objects in C# XNA where each objects has a transform that holds position, rotation and scale. I get my expected results If I draw my objects from my root node in this ...
34
votes
6answers
19k 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.