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.
602 questions
0
votes
0
answers
49
views
How to calculate the Number of blocks per column in an N step pyramid?
Designing a space game, where each ship has a certain size/ number of layers of armor.
for example 3 layers size 7.. .Which would look like this:
...
0
votes
0
answers
83
views
Rotation Matrix rotating in context over another Rotation Matrix
I have 2 rotation matrixes than work in a world that have three dimensions (X, Y and Z) being Y the one of the height.
One of such rotations works using Y dimension, from the point of the center of ...
0
votes
2
answers
115
views
Custom matrix structure with OpenGL shaders
I have a MAT4 structure.
...
0
votes
1
answer
161
views
How can I calculate vertex positions for a rectangle outline using a unit square, vertex normals, model matrix and outline thickness?
I'm trying to draw a hollow rectangle (i.e. the border of a rectangle without the middle) using a unit square plus normals. The actual positions are being calculated in my vertex shader.
For example, ...
0
votes
0
answers
104
views
How to make calculating the inverse matrix more robust?
When I calculated the inverse matrix, I found that the error in using the float data type would cause the inverse matrix calculation error. Is there any good solution?
...
2
votes
1
answer
678
views
How do I create a localtoworldmatrix and worldtolocalmatrix in Godot?
From what I can tell Godot uses Projection for 4x4 matrixes, but I see no way to generate a localtoworldmatrix from a given transform in Godot, how do I do this?
0
votes
1
answer
74
views
Rotate UVs in shader and contains result into quad with repeat edge pixels
I ask for help - I need to rotate the UV scan inside the quad by a certain angle (set by a parameter) so that the result is embedded in the original UV, and the missing areas are repeat edge pixels. ...
0
votes
1
answer
200
views
Inertia Tensor Relative to Center of Mass vs Inertia Tensor in Body Coordinates
If I have the inertia tensor relative to the center of mass, is that the same as the inertia tensor in body coordinates?
If no, can you please explain the difference and how do I numerically calculate ...
0
votes
1
answer
1k
views
How to set up view and model matrices for 3D rendering?
For various reasons I am building a very simple graphics engine. I have a pretty good 2D thing using plain SDL2 and C that essentially boils down to a single "putpixel" function. I can ...
0
votes
1
answer
125
views
Align two meshes given 2 faces
I have two meshes (A and B) and I know that a triangle in A has the same size and same angles as a triangle in B.
For simplicity, suppose A is an octahedron and B is a tetrahedron. And suppose the ...
0
votes
1
answer
1k
views
Calculating LookAt position from rotation and translation matrix
I was wondering if it was possible to calculate a lookat position from the translation and rotation matrices (aka the building blocks of my view matrix). I need the lookAt position to implement a ...
0
votes
1
answer
115
views
correct matrix to draw mesh as flat object
I need to draw a tilemap for a 2d game. For that I created vertices with their relative positions already hard baked. The coordinates start top-left with (0f, 0f) and z is always 0.
I rendered them to ...
0
votes
1
answer
81
views
Object stuck to screen no matter what eye position is used
I've run into an issue when trying to write a simple rendering program in D3D11. I'm 90% sure it's to do with some faulty matrix multiplication or generation, but I've tried debugging the values of ...
0
votes
0
answers
428
views
Setting glOrtho and glViewport so top-left of window has coordinates (0,0)
I haven't used OpenGL for a long time and have trouble setting up a 2D screen where the upper left window coordinates are (0,0) and the width and height of the ...
0
votes
0
answers
191
views
How does this 4 by 4 matrix (about 4 points are coplanar) come up with this equation?
I have just begun learning some 3d mathematics and OpenGL (trying to implement skeleton animation).
I am stuck here when reading a book(Advanced Methods in Computer Graphics). I understand the first ...
0
votes
1
answer
686
views
How to convert a list into coordinates in pygame
I'd like to have a map in my pygame game but don't want to waste time moving each individual object in it. To resolve this, I'd like to iterate over a list like this:
[1, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, ...
1
vote
0
answers
431
views
Understanding matrix transformations for skeletal animation
I am working with Collada and GLTF.
Say I have a humanoid with 3 bones with the following hierarchy: B0(root) → B1 → B2.
Terminology:
bind pose is the same thing ...
0
votes
1
answer
273
views
Why would some assets require a transposed TBN matrix?
I'm writing an OpenGL/DX11 Windows/Linux "engine" and I've encountered a confusing behavior in DX, specifically. For math, I'm using GLM, which means all of my HLSL ...
0
votes
1
answer
2k
views
How to calculate camera view matrix from world transform, specifically the orientation?
In my engine, camera is just any other object in the scene. It has a transform -- position, rotation (quaternion), and scale (ignored for camera view matrix). I want to convert this to the camera's ...
1
vote
1
answer
232
views
Speed up Reaction-Diffusion simulation calculations in Unity
I'm trying to use Unity Job system to speed up some calculation related to Reaction-Diffusion simulation. The calculations requires 2 matrixes, current and ...
0
votes
0
answers
944
views
How to decompose a GLSL mat4 to original RTS values within vertex shader?
I need to get the rotation differences between the model and the camera.
convert the values to radians/degrees and pass it to the fragment shader.
for that I need to decompose and the Model rotation ...
1
vote
1
answer
371
views
How to define custom coordinate space?
I'm trying to build small UI framework. And I want it to have a coordinate space such that origin is placed in top left corner (x increases to right, y increases to down). I think for UI it should be ...
1
vote
1
answer
112
views
Meshes seem to get distorted when I use rotate or zoom transforms (XNA/Monogame)
Whenever I seem to create a rotation matrix or try to zoom, the meshes that I draw to the screen get stretched and distorted.
I've tried to make a simple rotation matrix like this:
...
0
votes
0
answers
87
views
Right Axis warps on 3D planet's equator
I am using JavaScript and WebGL for a game which rotates a spaceship around a 3D planet. Below is the code for rotating a sphere spaceship and sphere planet. I looked over your camera code and now it ...
0
votes
2
answers
630
views
Is there a way to figure out in which quad I am in fragment shader?
In my openGL project I draw a lot of quads (composed from 2 triangles) - for sake of example let's say quad 0,1,2 and 3. I process them in single pass. I do transform them with projection view matrix ...