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)

1
vote
1answer
25 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
0answers
45 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
0answers
63 views

Constructing FPS camera transformation matrix using yaw and pitch

I'm trying to construct a FPS view matrix for my OpenGL renderer using yaw and pitch angles instead of the typical LookAt view matrix. I'm using the standard OpenGL coordiante, right-handed system ...
0
votes
1answer
22 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
0answers
13 views

Entity Transform Matrix Transformation (Movement and Rotation) Monogames

I started of by creating an Entity class containing a Transform property of Type Matrix which stores all the transformations such as Position, Rotation, Scale etc. I was able to move the entity and ...
4
votes
1answer
150 views

Map rigid body's transform to bone

I have the following ragdoll structure (green dots - bones, pinkish lines - bone links): The black boxes are Bullet's rigid bodies (boxes) constructed by creating an AABB of all mesh vertices that ...
0
votes
1answer
27 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
39 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
23 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
85 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
32 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
45 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
41 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
38 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
36 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
32 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
157 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
44 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
43 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
49 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
152 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
69 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
48 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
95 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
53 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
112 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
60 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
267 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 ...
1
vote
1answer
49 views

How to compute a transformation matrix that describes each position and rotation on a sphere?

I am having an issue constructing my transformation matrices, for this sphere problem. I know the 3d coordinate of the center, and the radius of, the sphere. Since I know the radius and center of ...
0
votes
2answers
75 views

Fastest way to neutralize scale in the transform matrix?

Let's assume we have 4x4 3D transformation matrix, that is the result of scale, rotation, and translation transforms. How to set its scale to (1,1,1) in the fastest way? Assume also that the matrix is ...
0
votes
0answers
51 views

How to spin a 2D quad in place using only matrices?

In short, I have a textured 2D quad (a sprite). I would like to rotate/spin it about the z-axis (coming out of the screen) using nothing but matrices. If I do the following to a transform with scale ...
1
vote
0answers
88 views

Control frustum near and far clip plane sizes in a Projection Matrix

I'm trying to achieve a dolly zoom effect. My first try was the obvious one, the original "zoom in & dolly out" technique, which works nicely. Except that there are cases which this is not ...
0
votes
0answers
53 views

How to Implement a 2d camera object for a side scroller game

Ok so Heres the problem. I'm Using c++ with sfml for graphics and box2d for physics. I've tried an ultra simple cam movement in the past where i lock the player to the center of the screen and offset ...
0
votes
2answers
82 views

OpenGL perspective matrix far plane

The near plane clips at exactly the value I set just fine but instead of clipping at 1000 the far plane clips at 1. Here is the code for the projection matrix: public static Matrix4f perspective(...
0
votes
0answers
24 views

JBullet & LWJGL Rendering objects with jbullet transform

I tried to render objects with jbullet matrix transform. Its something like that: get float array where is stored matrix then put it to floatbuffer and load to Matrix4f using load() function. Use ...
1
vote
1answer
55 views

What are projection independent ways of determining whether a normal is facing the viewer?

A position v and normal n are given in world coordinates. Also there is a view matrix V for world-eye coordinate transition and a projection matrix P for eye-ndc transition. I would like to determine, ...
0
votes
1answer
94 views

Projection Matrix Breaks My Rectangle

This is my vertex shader, shown below. #version 330 core in vec3 a_position; in vec4 a_colour; // FOV = 70, near plane = 0.1, far plane = 1000 const mat4 u_projection = mat4( 1.428148, 0.0, 0.0,...
0
votes
1answer
398 views

How do you build a rotation matrix from a normalized vector?

I'm trying to find the correct way to build a rotation matrix from a unit vector. I have two arbitrary points in space (p1 and p2), and I'm trying to create the vertices for a rectangle to span ...
1
vote
1answer
263 views

OpenGL Arc-Ball Camera Yaw Pitch GLM::Rotate

I'm currently working on a small Voxel-Editor Project. In the editor, I plan on using an Arc-Ball camera which rotate around the model. My camera is currently working but in an odd way. I can't seem ...
0
votes
1answer
244 views

Convert transform from world to local space

I have a hierarchical node system. Given a world space transform, I need to obtain the transform for a specific node in local space. My Node class has the following method. public void worldToLocal(...
0
votes
1answer
163 views

Mode 7 in xna/monogame

I want achieve a view like Mode 7 from snes games where the closer textures get stretched out more and more far away textures look smaller. Something like this: What I have in my project at the ...
1
vote
2answers
247 views

How to rotate camera using mouse?

I'm looking for a basic example of rotating camera using the mouse. the only problem is I'm not sure of how to rotating the camera around it target. should i do this by an algorithm or is there a ...
-1
votes
2answers
92 views

Rotation, what is the Matrix?

From a previous question, thank you very much by the way, but what on earth is the Matrix of? I'm very new to Mono/XNA and finding any meaningful documentation is practically impossible. point = ...
2
votes
1answer
63 views

Recap on how a camera works in 3d Space?

This may be marked as a duplicate, but I have been trouble thinking about a camera. I understand that there is a "camera transform," or view matrix. However, this is multiplied with every vertex in ...
0
votes
0answers
36 views

Rotate object from an origin using a transformation matrix

I'm making a project in lib GDX and I want to rotate an object by changing the transform matrix of the sprite batch to one that rotates an object rendered on screen a given number of degrees from a ...
4
votes
1answer
117 views

Do matrix manipulations for 3D graphics ever produce singular matrices?

A singular matrix is a matrix that cannot be inverted. The vecmath library, for example, throws a SingularMatrixException if you try to invert a singular matrix. I think I understand what singular ...
0
votes
0answers
12 views

Collision Hull not Transformed Correctly

My collision hulls aren't aligned after my "engine" digests them. I used Spine to create my content. So here is the hierarchical model of my bones. Where Root, LoadGame, NewGame, QuitGame, and ...
1
vote
1answer
65 views

What is more efficient: Using matrix translation to move a character, or using a vector/scalar?

In 2D or 3D, matrix transformations are used for rotation, scaling, and sheering. However, when it comes to movement, should I go out of my way to use and implement scalar/vector movement, or just ...
1
vote
1answer
75 views

Terminology for the way Transformation Matrix Data is treated

I recently asked a question at math stack exchange and realize a similar questions is more suited for this forum, but the original is here: http://math.stackexchange.com/questions/1526601/terminology-...
1
vote
1answer
37 views

Last Row of the perspective projection matrix

Could you explain to me what is the purpose of -1 in the last row of the gl_projection matrix? And how it affects the perspective division step ?