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.

learn more… | top users | synonyms (1)

0
votes
1answer
16 views

Visualize BoxCast

Im trying to find a way to visualize, and Edit the Physics2D.BoxCast from the Editor. I wrote the methods below to visualize the BoxCast, and edit in the editor: public Rect Box; private void ...
0
votes
1answer
32 views

How do i put XMMATRIX inside XMFLOAT4X4

I'm currently trying to move my weapon with the camera. To do this i'm creating a vector (tempVect) where i load how much the camera has moved compared to the weapon (in the code behind is just filled ...
0
votes
1answer
45 views

Unity Matrix4x4 to rotate a point around a pivot / axis

I need the Matrix4x4 to rotate around a given axis that does not go through (0,0,0). Is there some built in straightforward way to do this in the Unity libraries, or do I need to build and maintain my ...
3
votes
5answers
843 views

How and when do the model to world, world to view, et cetera multiplications happen?

I learn matrix transformations for game design and I struggle with some basic concepts. I see the actual multiplication taking place before rendering in this sequence: MODEL into WORLD: multiply each ...
0
votes
1answer
41 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: Eigen::Matrix3f R0; //rotation matrix Eigen::...
0
votes
2answers
64 views

Why does glm only have a translate function that returns a 4x4 matrix and not 3x3?

I'm working on a 2D game engine project and I want to implement matrices for my transformations (shocking I know) and I'm going to use the glm math library to do so. Since my game is only 2D I figured ...
0
votes
1answer
38 views

Matrix operations to flip 3d models front to back, without changing position

Multiple 3D objects look to be in the correct screen position, and I can move around them and this continues to be true, but each one looks like it is flipped back to front (I can see the backside of ...
0
votes
0answers
27 views

Lock Camera in orbit round sphere C++ / Matrices

Im sorry to ask here, but I have looked everywhere and I can't seem to get a C++ purely specific answer on how to solve this problem, most tutorials I have seen use game engines which have preset code ...
0
votes
1answer
49 views

convert gl_Position into screen coordinates

Pretty simple question I think. I need to convert model space coordinates into screen space coordinates for a special shader effect. I am of course able to just convert them into gl_Position ...
0
votes
0answers
37 views

javascript - Get x and y values from computed CSS matrix3d?

This example (which works only on Safari), uses the deprecated function webkitConvertPointFromPageToNode var point = webkitConvertPointFromPageToNode ( fieldContainerH, ...
0
votes
0answers
23 views

How do I apply camera local space values to world space in Direct X 11

I'm trying to rotate the camera around its local axis, and then apply the new values of the camera to world space. At the moment the camera seems to rotate around the correct axis, but the lookat ...
0
votes
2answers
108 views

multiply matrix4x4 with vec4

I'm developing a game and I'd like to make model * pos4 calc (that's usual in glsl vertex shader) in cpu instead of doing it in gpu. I'm using LWJGL and for the math impl I use JOML. Anyone know how ...
4
votes
1answer
103 views

How do you make a camera look at a box and ensure all of it is visible?

In most game engines (Unity, UE4) if we select a model and press F, the camera moves and focuses to the selected model. I want to implement that for my models. I have a perspective camera and world ...
3
votes
1answer
52 views

Issues with OpenGL rotation matricies and shaders

I am having an issue with my rotations in my opengl shaders. My program works fine before I add in my rotation matrices. Here is an example, at YouTube. After I add rotations to my shaders, there are ...
1
vote
1answer
47 views

What is the best way of storing transformations for an object and then applying them with OpenGL?

First some background info... I have been working on a platformer game, which I draw with OpenGL. The platforms are cubes and the player is a cube. The platforms and the player (both cubes) are ...
0
votes
1answer
67 views

What's the difference between setTransformMatrix and setProjectionMatrix in LibGDX?

There are two method of SpriteBatch in LibGDX: setTransformMatrxi and setProjectionMatrix. I know one can use batch.setProjectionMatrix(camera.combined) to define how/where an object should be ...
0
votes
0answers
30 views

How can I calculate a corrected oblique clipping matrix?

This problem has been eating at me for a little while now, and it's extremely frustrating. Unity calculates culling matrices incorrectly. From the matrix, it seems to generate the actual occlusion ...
4
votes
0answers
41 views

How to clip cut-off using different frustrum than that of original camera? How to cut plane by pyramid shape?

SOURCE : http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2012/10/Mitchell_LightShafts.pdf This process is part of creating light draft effect. And I am suggested to do the described process in ...
0
votes
0answers
28 views

Get face translation/rotation/scaling from 2d face

I have a 2d face stored in a vbo. This face is along xy axis. Then I have a cube that I have to render with using this face. The cube is defined by firstPosition and secondPosition. In some way (I ...
1
vote
1answer
50 views

Help Understanding Cameras/View Matrices in DirectX11 (C#)

So I'm designing a soft game engine in C# on top of the SharpDX API (a C# wrapper for DirectX). As I'm designing the camera, though, I'm running into some issues getting the 3D perspective correct. I'...
0
votes
0answers
39 views

OpenGL Vertex shader matrix multiplication causes triangle to disappear

So i have a very basic functioning application, rendering a basic triangle (using vertex and fragment shaders) When I try to multiply the in-vector in the vertex shader with a mat4 the triangle ...
0
votes
1answer
61 views

Rendering perspective independent polygons in perspective view

I am creating an editor where I have "grabhandles" that can be dragged to transform a primitive object. My problem is that I can't find the correct solution to show these grabhandles in a perspective ...
1
vote
0answers
67 views

Cube Translation Looks All Wrong

I'm making a very simple cube in OpenTK and it seemed to be going fine until I tried to move it around. Moving it along the X Axis seems to elongate the cube, not the result I hoped for. My Vertex ...
0
votes
1answer
56 views

openGL Vertex Projection does not work as expected

I try to render a simple grid using glBegin(GL_LINES). I have a class Camera, which provides values like this: float farPlane = 100.0f; float nearPlane= 0.1f; float screenRatio = 1,42857; //width/...
1
vote
2answers
82 views

How do I create a view matrix that does not contain the camera translation?

I'm looking at this tutorial https://capnramses.github.io/opengl/cubemaps.html about half way down the webpage, there is a description of a vertex shader #version 400 in vec3 vp; uniform mat4 P, V; ...
1
vote
1answer
51 views

Passing Matrix to shader

I am learning HLSL and having trouble understanding how to pass matrices into the shaders to be able to perform the necessary operations within the shader to have the position values sent to the ...
1
vote
1answer
160 views

Getting world coordinates from mouse position

I am drawing a 2D mesh imported from CAD. The mesh vertex coordinates are in feet from some arbitrary origin and Z is always 0. I am supplying the coordinates to my shader program and using projection ...
0
votes
1answer
43 views

How to rotate to look at target

I have found other questions like this, but none seem to quite cover the situation I have. I am using DirectX 11 I have an object that has: Position (vector) Rotation (quaternion) View angle (pitch,...
0
votes
1answer
108 views

How would you design a transformation matrix to project absolute coordinates to any orthographic projection desired?

I am attempting to make an RTS based on AoE II HD Edition. I want to have ease of control by designing a transformation matrix given any style of projection I want. This is a good example of what I ...
1
vote
1answer
62 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 ...
0
votes
1answer
33 views

Transform point while keeping other points offset

I have the following situation: I've got a box with its center of mass transform matrix that I'm obtaining from physics simulation, i.e. it keeps changing with time. I've also got two points (actually ...
0
votes
2answers
92 views

Finding the Distance between 2 Objects

I have 2 objects One Having a Transformation Matrix T1 and other Having Transformation Matrix T2. And We are having a View Matrix V and Projection Matrix P. Basically 2 Object are render using this ...
1
vote
0answers
43 views

Understanding the ModelView Matrix

I want to analyze the each component of my 4*4 ModelView Matrix. I came to know that the starting 3*3 of ModelView Matrix stores rotation. If i want my object to have no rotation with respect to ...
1
vote
0answers
63 views

Rotating an Object Around an Axis

I have a circular shape object, which I want to rotate like a fan along it's own axis. I can change the rotation in any direction i.e. dx, dy, dz using my transformation matrix. The following it's ...
1
vote
0answers
103 views

how to properly rotate in directX11

I am trying to Rotate a textured quad in directX however I think i am missing something. I am pretty sure it is because i am applying transformations to the WorldMatrix instead of the ObjectWorld, ...
1
vote
0answers
50 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
52 views

Opengl: 2D Set the origin to center of the +x, +y quadrant and render quads from from (0.0, 0.0)

I'm developing a 100% 2D program. Presently, the origin is at 0,0,0 (dead center of the screen). I feel as though this is wrong for my app. It's a little unnatural for me to position things in the ...
0
votes
0answers
33 views

When do we use inverses of a matrix in Game programming? [duplicate]

I was wondering when do we use inverses of a matrix when programing games. For what reason? The camera?
0
votes
0answers
197 views

How to rotate a gizmo cube between two waypoints?

I have been struggling with this for a while, and I can't find a solution on the internet. I am making a waypoint system with the Unity editor tools with Gizmos. Cars, boats, people will follow a ...
1
vote
1answer
51 views

2D World Mouse Coordinates - Matrices

I'm trying to get the world coordinates out of a mouse click. Currently I'm doing the following: var invertedMatrix = mat4.create(); var viewMatrix = activeCamera.getMatrix(); mat4.invert(...
2
votes
0answers
65 views

Problem Rendering a Wireframe Cube and Grid with DirectX 11

I am trying to draw a 3D Wireframe (just the lines that connect each vertex) Cube and a 10x10 grid with D3D11. So far, this is my code //************************************************************ //...
1
vote
1answer
51 views

How Matrix4 represents an object in space and matrix lore

I have been following some tutorial's on how Matrix maths works, with adding, dividing, scaling, etc, but I am struggling to understand how the 4x4 matrix represents an object's position in space. ...
3
votes
1answer
235 views

Translation Matrix not working properly

Hello, I get this result when i try to scale and then translate a vec4 in my shader. I created a mat4x4 class on my own and some functions wich return some matrices for me, everything works, but not ...
3
votes
1answer
76 views

Optimizing black and white matrix block drawing

Disclaimer: I am uncertain if this is the best place to post this question, so please advise me of how I can best find the answer if I am doing something wrong. I am asking this question because I am ...
1
vote
1answer
53 views

How to convert -1 to 1 coordinate back to screen coordinates?

Here is a question in which Questioner asks how to convert world coordinates to 1 to -1 coordinates like Opengl, I want to know how to do that in reverse, that given a coordinates between 1 and -1 (...
0
votes
1answer
157 views

js canvas tiled map - for loop, while, or matrix

I am making a top-down view tiled map in canvas, where player is always in the middle of the screen, and map scrolls depending on where you go, like in moba games. I also want it to loop infinitely in ...
1
vote
1answer
78 views

Deferred rendering - reconstruction of world position view dependent

I am moving my small renderer from forward to deferred, I have now noticed something a bit odd. I am for now using a simple way to reconstruct world position in the lighting pass: float3 GetWP(...
1
vote
2answers
130 views

Get the difference between 2 matrices

Hi I'm using C# and MonoGame, and have the world matrices of 2 objects. I need to get the difference between them, so I can effectively parent the second object onto the first. The aim is to get to a ...
2
votes
1answer
83 views

DX11 Camera not working properly

I'm currently trying to implement a ArcBall Camera which should fly around a given XMFLOAT3 position stored in a cb with a spezified distance to the position. I used the code from Allen Sherrod for ...
0
votes
1answer
581 views

Extract a rotation matrix given a camera direction (vector) and a up vector for the camera?

I am having some issues constructing a rotation matrix from a camera direction vector. The Up vector is computed from the camera direction as such: up = cross(cross(direc,(0,1,0)),direc) How do i ...