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.

Filter by
Sorted by
Tagged with
0
votes
1answer
117 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: ...
1
vote
0answers
37 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
267 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 ...
0
votes
1answer
64 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
43 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? ...
0
votes
1answer
23 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 ...
1
vote
1answer
1k 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 ...
1
vote
3answers
499 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: ...
1
vote
1answer
478 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
1answer
100 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 ...
1
vote
1answer
220 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 ...
0
votes
0answers
32 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
88 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. ...
1
vote
0answers
185 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
39 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
33 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 ...
3
votes
2answers
527 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
43 views

Optimizing expensive calculation for calculating touch of side of cube

I have this code: ...
0
votes
2answers
61 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 ...
1
vote
1answer
65 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 <...
1
vote
1answer
376 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
1answer
87 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 ...
2
votes
1answer
2k views

Why do these DirectXMath functions seem like they return column-major matrics?

I know these questions have been asked a million times in various formats, but I'm getting weirdly skeptical about some of the row-major vs. column-major claims about the DirectXMath library. If I ...
0
votes
1answer
143 views

Change center point and size with the help of the Matrix in Unity

Let us suppose I have an array of Vector3, it contains vertices. Now I want to scale the vertices and/or change the center point of the texture (move texture ...
0
votes
1answer
1k views

What is FRotationMatrix in Unreal engine 4?

I am working on FPS shooter example in Unreal engine 4 documentation. One of the lines for forward movement of pawn is ...
-1
votes
1answer
265 views

Get enemy/chaser object to face player object - OpenGL

My chaser object will not face the player object. It simply keeps spinning around and won't face the player. ...
1
vote
2answers
185 views

TRS Matrix between 2 points

I have got 2 Points in 3D Space whose TRS Matrix' from 0.0 to there current place is known. Now I want to change the Matrix of the left point so that the matrix of the right point combined with the ...
4
votes
1answer
100 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
82 views

Split a grid into shapes that can be moved back from 4 directions

Basically I have 4 grids Left, Right, Top, Bottom. Player can choose each of them and move all the blocks on that grid to the Middle grid to fulfill it, like tetris from 4 directions: ...
0
votes
1answer
65 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
397 views

Setting relative anchor point via matrix

The page at https://webglfundamentals.org/webgl/lessons/webgl-2d-matrices.html provides an example for rotating around the center of the image: ...
3
votes
1answer
6k views

lookAt with orthographic camera (gl-matrix)

Technically this is a webgl question though I think it's generic enough to get some opengl, erm, perspective on it too... If I setup an orthographic camera (perspective matrix) like this: ...
3
votes
1answer
7k views

How to mirror/reflect/flip a 4D transformation matrix

I am importing my animation keyframe joint data from Blender to my game engine. The joint data is a set of 4D matrices. Things are looking good except a remaining issue where the animation is facing ...
0
votes
1answer
1k views

How to Convert a Z Up Matrix to a Y Up Matrix?

My 3D program exports my vertex data and instancing matrixes in Z+ up format. I want to store them in my own data format as Y+ up. If given a Matrix4 describing a position with Z+ being up. How can ...
0
votes
1answer
741 views

Matrix multiplication order for multiple model transformations

I have a problem in terms of what frame of reference, I should construct, scaling (S), rotation (R) and translation (T) for a model matrix (in that order). Let us assume the use of glm (or glsl), i.e. ...
4
votes
2answers
615 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
587 views

SceneKit-Convert a rotation vector into rotation matrix

I'm very new and I'm studying this ARKit code from RPasecky/CubesInSpace on github where he/she convert the point of view 's rotation vector into a rotation matrix ...
0
votes
1answer
137 views

Matrix transformations vs manipulating vertex data directly

I was wondering whats more efficient to do if you want to transform a mesh. 1) Transforming a matrix and pass that to a shader or 2) Manipulate the meshs vertex data directly I was wondering because ...
0
votes
1answer
3k views

Convert Quaternion to Matrix4x4

I'm trying to set Gizmos.matrix which is a 4x4 by matrix such that the gizmos drawn match the rotation of the object. However, I'm not sure how to convert the ...
0
votes
1answer
112 views

Oscillate an object's scale

I am able to scale an object using a scaling function I wrote. Internally it builds matrices that are multiplied by each of the vertices to transform them. The parameters I give the scaling function ...
1
vote
1answer
164 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
0answers
544 views

Mythbuster: Mirror Operation with Quaternion

Mirror operation : all vertex positions must be reflected by a specific plane (here YZ).Synonyms: FlipHorizontal, SymmetryX, MirrorX, What implementations I already know that work: 1) Multiplying ...
1
vote
2answers
1k views

Applying “zoom to the exact point” transformations to screen positions

I´ve implemented zooming of orthographic camera (just scaling it with its speed value): ...
0
votes
0answers
394 views

How to compose a matrix to perform isometric (dimetric) projection of a world coordinate?

I have a 2D unit vector containing a world coordinate (the player's direction), and I want to convert that to screen coordinates (classic isometric tiles). I'm aware I can achieve this by rotating ...
0
votes
1answer
63 views

Are there any math limitations on the near plane in a perspective matrix?

I've noted that if in the perspective camera I put near plane to a low number like 0.000001 and far plane to 1000 my render has ...
2
votes
1answer
497 views

Convertion from 3D to 2D openGL

Few days ago , we learned about Homogeneous Matrices in OpenGL class. From what I have understood , using these matrices we can convert 3D objects to 2D. However , I am facing some difficulties ...
2
votes
2answers
120 views

How many matrices do i need to represent a rectangular figure and translate it?

I'm learning math at the moment and i can't really understand the purpose of the matrix. Yes, i've watched several tutorials out there and reading the book but still confused. Correct me if i'm wrong....
1
vote
2answers
974 views

Transform inertia tensor using quaternion

I have inertia tensor T in body coordinates and quaternion q for the body. I know I can transform T to world coordinate by converting quaternion to rotation matrix R and then use the relation (R * T * ...
0
votes
1answer
440 views

Left-handed version of the reversed depth projection with infinite far plane

Let's say that I have standard left-handed WorldToView and ViewToScreen row-major matrices in the same vein as the DirectX ...
0
votes
1answer
36 views

View Matrix FINDING U

T<----------------------Q While making a view matrix, I usually cross product a (0,1,0) with W TO GET U W = (T-Q)/||T-Q|| U = (W X (0,1,0)/||W X (0,1,0) v = w x u this works most of the time. ...

1
2
3 4 5
11