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
0 answers
20 views

retargeting: Am I on the right track?

I try to retarget the position of a bone in the rest position to adapt it to a different model. The goal is to have my animation properly working for two models from one animation. It is the child ...
user avatar
  • 101
0 votes
0 answers
23 views

Apply a mocap to multiple different models? -> modify gltf directly?

I am currently struggling with an animation I made that I would like applied to multiple models, all different, but from the same vertices. I already have a custom gltf importer ready but I need to ...
user avatar
  • 101
0 votes
1 answer
35 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 ...
user avatar
  • 101
0 votes
1 answer
22 views

Matrix math: How to specify camera distance so that an object with a given size is completely visible?

This is my code that draws a top down view tile based map. But Iam do not know how high the camera needs to be placed in the sky so that the map is fully visible so that nothing is cut away and I do ...
user avatar
  • 334
0 votes
1 answer
14 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 ...
user avatar
  • 189
0 votes
1 answer
23 views

Find out (general) orientation of cube faces with rotated and translated camera

I have the following problem. I have a camera that is initially looking at a cube. The cube is with center at (0, 0, 0). The camera that is initially on (0, 0, 60). The camera can rotate and translate ...
user avatar
1 vote
1 answer
88 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 ...
user avatar
  • 117
0 votes
1 answer
29 views

How are transformation matrices usually represented?

I know the bare minimum to do matrix multiplication and have implemented them from scratch a few times for various purposes, but every time I do, I make sure to be very clear to myself about where are ...
user avatar
0 votes
0 answers
30 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 ...
user avatar
1 vote
0 answers
49 views

What is the correct way to combine transforms together?

I have a type called transform in my game engine: ...
user avatar
1 vote
1 answer
188 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 ...
user avatar
1 vote
1 answer
21 views

Get local position of a skinned vertex

I have a formula for skinning, where a vertex is attached to 2 joints with some proportions: B = M1*A*K1 + M2*A*K1 Where: K1 and K2 are the proportion ...
user avatar
1 vote
0 answers
22 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: ...
user avatar
1 vote
2 answers
45 views

How to solve for the angle of a axis/angle rotation that gets me closest to a specific orientation

I’m using a 3D affine transform (a 4x4 matrix of floats) to represent a combination of translations and rotations in 3D space doing a sort of 3D turtle graphics kind of thing. From this state I know ...
user avatar
  • 138
0 votes
0 answers
31 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 on a flat plane. ...
user avatar
0 votes
0 answers
35 views

Trying to understand proper naming of transformations and coordinate systems

So far in my code I only dealt with transform matrices that I fed to OpenGL (the 4x4 float matrices), and had a class that was used to do transformations on the CPU side and generate the OpenGL ...
user avatar
  • 163
0 votes
2 answers
73 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 ...
user avatar
0 votes
1 answer
161 views

2d zooming function using transformation matrix

I'm trying to create a sort of "graphing calculator coordinate system" where you can zoom into a point by scrolling with the mouse wheel. I'm using javafx's transformation matrices (Affines) ...
user avatar
0 votes
1 answer
37 views

Rotation matrix for a model where the forward axis is not +X

I'm trying to convert a normalized unit vector, representing an entity heading, into a rotation matrix for rendering. The problem is that I'm using an (apparently) unusual forward vector for my ...
user avatar
  • 762
0 votes
0 answers
46 views

Obj file vertex coordinates to new coordinate space

I am trying to convert the vertex positions in my obj file to a new coordinate system. I understand I need to multiply each vertex with the transformation matrix, however I am trying to figure out the ...
user avatar
  • 101
0 votes
1 answer
64 views

Calculating view matrix from rotation, elevation and location

I have the rotation(A), elevation(B) and location(C) of a camera in a left handed 3d space. +...
user avatar
  • 101
0 votes
1 answer
255 views

Difference between World matrix and Model matrix?

My current understanding of the Model matrix is that it is per object and stores the transformation, rotation, and scale of the object in local object space. What I'm not sure about, is that whether ...
user avatar
1 vote
1 answer
107 views

What are the pros and cons to using Transform{position, scale, rotation} over Matrix (3x4)?

I'm using Transform in a certain case where I want extracting/changing/preserving the components {position, scale, rotation} to be straightforward - I guess that is a benefit. But when it comes to ...
user avatar
  • 111
0 votes
0 answers
62 views

3D to 2D transformations with numpy

I am trying to create my own game in the python terminal, but I just can't find something I can use in python. I found something on https://www.gamedev.net/forums/topic/59091-projection-matrix-amp-3d-...
user avatar
2 votes
1 answer
116 views

Matrix math in cascade shadow mapping

I am implementing cascade shadow mapping algorithm and currently stuck with matrix transformations - my AABBs, when projected in light space are pointing in the direction opposite to the light: I was ...
user avatar
2 votes
1 answer
433 views

Drawing OpenGL camera frustum

I am trying to display camera frustum in my OpenGL application. I calculate the vertices of the frustum pyramid using reverse projection from screen space to world space. The camera uses perspective ...
user avatar
0 votes
1 answer
165 views

How do I make 2D Camera Matrix with zoom?

I trying to understand how to make a 2D Camera Matrix. The problem now is when I zoom the world shifts horizontally. The Camera need to zoom on the current Position. ...
user avatar
  • 3
0 votes
1 answer
39 views

Scene graph with camera

I need help with a little problem in my project, in which I have a scene graph with the intented camera like this: MovementNode Camera Node Mesh Object My problem is that I have the propagation of ...
user avatar
  • 1
0 votes
1 answer
122 views

How to rotate multi-tile structure on grid?

I need to be able to place structures in my game that span multiple tiles and can also be rotated. My idea on how to solve this would be to use 2D arrays that hold data about the structure. EXAMPLE: (...
user avatar
1 vote
1 answer
120 views

Need help getting an objects orientation / all my OpenGL rotations are reversed

I'm using OpenGL on Ubuntu Linux with the Eclipse IDE and the GCC compiler. I am bringing blender models into a homemade renderer/game engine. I parse a text file containing object descriptions to ...
user avatar
  • 11
0 votes
1 answer
187 views

convert world to screen coordinates with camera position and camera angle

Heyho :) I'm trying to convert world coordinates to screen coordinates. I have available: fov, screen width, screen height, camera position, camera angle and obviously the position of the object in ...
user avatar
  • 1
0 votes
3 answers
325 views

Calculate angular velocity from rotation matrix difference

I am working on something for a game. I need to calculate the angular velocity, however in my situation I only have access to the previous rotation matrix and the current rotation matrix (and some ...
user avatar
  • 5
0 votes
1 answer
208 views

Invert parent transform (doesn't work for combination of rotation and scale)

My problem I'm working with Qt3D and my problem is almost exactly like this one: https://stackoverflow.com/q/60995155/3405291 Suggested solution A solution is suggested here: https://stackoverflow.com/...
user avatar
0 votes
1 answer
1k views

How does glm::lookAt produce a View Matrix?

Say we do this: glm::mat4 View = glm::lookAt(glm::vec3(4,3,-3), glm::vec3(0,0,0),glm::vec3(0,1,0)); And after printing to the console with glm tostring (column ...
user avatar
  • 11
0 votes
1 answer
128 views

Convert Global Space 3D Location to Local object space?

I'm trying to find a formula that could convert my 3D global coordinates into local object space. Here are the inputs I have ...
user avatar
  • 103
0 votes
1 answer
140 views

Cylindrical billboarding around an arbitrary axis in geometry shader

I found an answer on this site relating to this question already, but it doesn't seem applicable in the context of my project. Basically I'd like to create a method which fits this signature: ...
user avatar
  • 101
1 vote
1 answer
2k views

How to decompose a 4x4 TRS transformation matrix with negative scale?

As the title says I need to decompose 4x4 TRS transformation matrices and extract the proper scale vectors and the proper rotation vectors (or rotation quaternions). I know how to extract those ...
user avatar
0 votes
0 answers
96 views

Shifting the world origin and scaling all points?

Imagine you have a simulation in very large coordinates, and to render it out you need to scale it down (say, solar system -> fitting inside a few thousand units). This is controlled by a float ...
user avatar
1 vote
0 answers
56 views

Matrix transforming with translation/rotation/scale at center of screen

I'm trying to create a camera using matrix transforms, the gist is as follows: ...
user avatar
0 votes
1 answer
180 views

Random 100x100 map using all levels from 1 to 100

I'm developing a game where players walk though a 100x100 grid of different rooms. Each room has a level associated with it starting from lvl 1 to lvl 100. The map is divided into 10x10 areas and in ...
user avatar
1 vote
1 answer
60 views

Rotation matrix to look at point p

Assume a left-handed coordinate system where x is right, y is up, and z is into the screen. You have a unit vector pointing up along the y-axis. What's the rotation matrix for pointing the unit vector ...
user avatar
0 votes
0 answers
36 views

What is an efficient way to get a look-at direction from either a quaternion or a transformation matrix?

So, I have an object in my custom engine (C++), with a column-major transform in world space. I'm using a package that takes a look-at direction as an input. What's the most efficient way to get a ...
user avatar
  • 3
2 votes
1 answer
219 views

Rotate Object in world space - Raytracing

I’m programming a C raytracing project. I’ve been wanting to implement object rotations (square, cylinder) for several days but I can’t do it. For each object I have its position (x, y, z) in the ...
user avatar
  • 21
1 vote
0 answers
23 views

Recognize L-Shape in a 4x4 Matrix

I'm trying to make a board game, there the player has to press four buttons to make the L. It can be mirrored or rotated, it just has to be an L. But if the player press four buttons and make another ...
user avatar
0 votes
1 answer
49 views

Match-3 should pieces store their location in the matrix?

I'm making a match-3 game. I have a TileManager script which stores all the tiles in a matrix, it's a singleton and it handles tile swapping and basicly everything regarding the management of tiles. I ...
user avatar
  • 135
0 votes
0 answers
294 views

Intersection of ray and non-axis-aligned box

I need to compute the intersection of a ray with a non-axis aligned box. Currently, I transform the ray into the local space of the box, do classic ray-AABB intersection and transform the intersection ...
user avatar
  • 101
0 votes
1 answer
185 views

What is the signifigance of the Dot Product in World to Local Transformations?

Looking for help understanding why this World to Local Space function works. I'm working my way through Buckland's Programming Game AI By Example The following function is used in the book to convert ...
user avatar
0 votes
1 answer
1k views

Should 3D transformations be represented by a 4x4 matrix or a 3x4 matrix?

Since 3D transformations are represented by 4x4 homogeneous matrices we know that their last row is always (0,0,0,1), and as such the behavior of this final row is implied so long as we know whether ...
user avatar
  • 167
0 votes
0 answers
29 views

Projecting Coordinates from one Space into another, but with "twisting"

i'm trying to generate a decal mesh kinda like this: http://blog.wolfire.com/2009/06/how-to-project-decals/ but instead of projecting the decal with a box, i need to project it with a sort of ...
user avatar
1 vote
0 answers
67 views

Can't get world position from reverse Z buffer

I'm using this solution to render using a reversed Z buffer. This looks fine and completely fixes all my z-fighting, but it breaks what I use in shader to derive the world position from the depth for ...
user avatar
  • 11

1
2 3 4 5
12