An array of numbers, symbols or expressions, arranged in row and columns. The numbers, symbols or expressions themselves are called elements or entries.

learn more… | top users | synonyms (1)

0
votes
0answers
5 views

Frustum culling based on MVP matrix?

Tutorial on the internet usually say to extract plane data from MVP (model view projection) matrix (or VP?) and then test the bouding volume against each of the frustum planes. I've thought of a ...
0
votes
2answers
46 views

What dimensions should you use for a perspective projection frustum?

What dimensions should you use for a perspective projection frustum? Initially I created a perspective matrix based on the width and height of the screen, with a calculated zNear value based on a ...
0
votes
0answers
27 views

XNA - Link between Create Rotations matrices

A friend of mine have been coding some rotations on my XNA project, but the order of the matrices rotation are not good. Some are of form : Matrix.CreateRotationZ(1.21f) * ...
2
votes
2answers
54 views

How to use camera transformation without depending on (1,-1) scale during spriteBatch.draw()

I am creating a 2D platformer type game in XNA. I currently have a camera object, with a position/rotation/zoomlevel that I use to generate a transformation matrix to pass to SpriteBatch.Begin(). ...
0
votes
3answers
94 views

OpenGL: glRotatef cause performance drop while rotating -x and -y

I have made a rotating cube and I got some performance drops while using two glRotatef calls. So basically this code is giving me 80FPS: //code 1 GLrotate_x += 0.4f; GLrotate_y += 0.4f; ...
0
votes
0answers
48 views

Matrix Translate Camera has some sort of spiky movement

public class Camera2D { private Vector2 _position; protected float _viewportHeight; protected float _viewportWidth; public Vector2 ScreenCenter; protected Being _unit; // the sprite camera is ...
1
vote
1answer
60 views

The correct way to transform a ray with a matrix?

Playing with XNA Triangle Picking Sample I found out that it does not work well if you scale the world matrix of the objects you want to pick. When I dug into the implementation I found this comment ...
0
votes
1answer
60 views

Distorted LookAt When Looking Up or Down?

I have a weird problem and I have no idea what's going on with it. Recently started doing some OpenGL programming, going pretty well, hit some rough spots but worked my way through them and otherwise ...
12
votes
3answers
1k views

Why do we use 4x4 matrices to transform things in 3D?

To translate a vector by 10 unit in the X direction, why do we have to use a matrix? We can just add 10 to the mat[0][0], and we got the same result too.
0
votes
0answers
29 views

Checking if a object is blocking my view of a light (it's between light and camera)

I'm trying to determine, from a list of objects, which ones are blocking my view of a light. In other words: which ones are between the light and the camera. Coding in C++, using HPL1Engine. This is ...
0
votes
1answer
68 views

Relative Position/Rotation calculation

I have 2 objects each with a 3x3 Matrix (Orientation) and a Vector3 (Translation). Both are relative to world coordinates. How do I calculate the position and orientation of object B in relation to ...
2
votes
2answers
25 views

Derive direction in which a spot light emites its light from a projection matrix

First of all, sorry if my question sounds too basic or even makes no sense. I'm new with game development I'm working with HPL1Engine, specifically, the lights parts. I need to know the direction in ...
0
votes
1answer
94 views

First person camera world matrix issue (in THREE.js and webGL)

I'm trying to create a Portal-like effect in webGL using THREE.js. I have two scenes connected by a pair of portals. The view of the 2nd scene in rendered inside the 1st portal using stencils and ...
1
vote
0answers
83 views

How should matrix-based Parallax Scrolling work?

The question is at the end, as it requires a bit of context. I'm not sure if my understanding, my code, or LibGDX's ParallaxCamera is wrong. LibGDX's ParallaxCamera uses Matrix4s to achieve a ...
0
votes
0answers
90 views

Alter a model-view-projection matrix

I have a model-view-projection matrix created based upon my camera. Is it possible to make alterations to it after it was computed to affect the corners of the resulting camera frustrum? For example, ...
0
votes
1answer
213 views

Screen space decals, converting world to decal space

I'm trying to do screen space deferred decals following the presentation made by Pope Kim about SSDs in WH40K: Space Marine (link). I've gotten to the point where I can render a decal if the bounding ...
0
votes
0answers
44 views

“Blinking” graphical bug when rotating shadow matrix

So, we have implemented Krypton shadows into our code for our 2D game, and it's working beautifully. Only issue is that we're running into a bizarre graphical bug when rotating the shadows with the ...
6
votes
0answers
158 views

Rotation pitch/yaw reverse problems when picking a tile (2.5D) [closed]

Set-up: 3D world, isometric sprite rendering (4 fixed angles). This transform matrix is used as camera: _transform = Matrix.CreateRotationZ(Roll) * ...
2
votes
1answer
105 views

Finding out the “width” and “height” of my screen after projection added

In a 2d game, doing collisions with the edges of your screen is easy. Your textures are a 1:1 mapping of your screen resolution because your verities are too.. if your x position is > than ( screen ...
0
votes
3answers
104 views

How can I properly rotate a 2D vector in the “flipped” XNA client space?

In my 2d XNA game, because SpriteBatch treats world space as client space and has positive Y axis down and negative up, I've built my game's world space with that coordinate system too. However, I've ...
0
votes
1answer
142 views

XNA 2D Camera, zoom into player

My 2D camera follows the character fine without any zooming. However, when I tried adding a zoom feature using the Matrix.CreateScale(), the camera no longer follows the character properly. public ...
2
votes
2answers
181 views

Why translation uses multiplication and not addition? [closed]

To translate an object from (x, y, z) to (a + x, b + y, c + z) it's done using: OK, that's cool, but why would we multiply in the first place when we can add the two matrices directly as: ...
0
votes
1answer
64 views

How can I adjust the UVs of my quad so my texture isn't flipped?

My sprite geometry is reversed using matrix so that it is in the XZ plane. This results in the image used for the sprite to also be reversed, which I don't want: (source : ...
2
votes
1answer
75 views

Light Space and Light Texture Space in shaders

I'm looking into material translucency and I'm working through some GPU Gems documentation (http://http.developer.nvidia.com/GPUGems/gpugems_ch16.html). In Example 16-4 it references matrices for ...
14
votes
4answers
1k views

What does a matrix represent?

I began learning OpenGL recently and am having problems visualizing what matrices are and their role in computer graphics. Given the template of a 4x4 matrix like this: I would assume that each ...
0
votes
0answers
38 views

Matrix transforms with SpriteBatch overloading - how do you rotate/zoom around a point? [duplicate]

I have a transform matrix which works as intended for game objects I want to be completely controlled by my camera: _transform = Matrix.Identity * Matrix.CreateTranslation(-_position.X, ...
0
votes
1answer
51 views

How to modify normal vectors with a tranformation matrix

Transformation is quite simple when it comes to Position or Color of the vertex, for Position just multiply matrix * vector and for color just don't do anything, but my question now is: How to handle ...
0
votes
2answers
122 views

Keep Mini map static after rotating / zooming with camera

Hi I am making a 2D game, where the Camera is able to rotate / zoom in or out on the camera focus (the player usually). However my game also contains a mini-map, and so far whenever I have to rotate ...
3
votes
4answers
227 views

Why not use vectors to represent orientation?

From what I've read, people mostly use either quaternions or 3x3 matrices to represent 3D orientations, while plain vectors are used for angular velocity/momentum. Since we can use vectors to ...
1
vote
1answer
87 views

Does a 2D Vector or 2x2 Matrix play any role in 2D Transformations?

I'm having trouble trying to figure out if a vec2 or mat2 class are used at all in transformations for 2D rendering. Vec2, apart from representing UVs, AFAIK, is relatively pointless in regards to ...
0
votes
1answer
53 views

Multiplying matrices in HLSL

I have code that calculates a position like this in HLSL: output.ShadowPos = input.VertexPos; output.ShadowPos = mul(output.ShadowPos, gWorld); output.ShadowPos = mul(output.ShadowPos, ...
1
vote
2answers
85 views

Encode world matrix as 2 float4s?

On one of the slides of their presentation "Batch, Batch, Batch!" guys from NVidia suggest encoding animation matrices for pallet skinning into two float4s as: • axis/angle • ...
0
votes
1answer
38 views

Rotate final image with projection matrix

I'm trying to use space in my shadow (depth) maps in a more efficient way. If I could freely rotate the final image I get with projection matrix I could save a lot of pixels, but I don't know if it is ...
1
vote
1answer
69 views

How to make child transforms honor parent origin

I'm working on a 2D transform system that has the following requirements: Transforms can have children Transforms have anchor points/origins that offset them Children should honor the parent's ...
4
votes
5answers
433 views

How to rotate an object around world aligned axes?

I have a Vector3 which has an euler angle for each axis. Usually, when I want to create a rotation matrix I will use functions such as D3DXMatrixRotationX passing the respective angle from my ...
0
votes
0answers
43 views

W2S, worldtoscreen from Projection Matrix and View Matrix

After a couple of days of tremendous trial and error coding, I must give up: I have a simple 3d program that I'm adding a visual layer to. Basically, I want to draw 2d icons and text over 3d objects ...
3
votes
1answer
208 views

How to move an object up and down like a wave?

I am trying to move my object up and down using cos and sin, but I have problem understanding how does the sin and cos work, so I can make my object move up and down like a wave frequently Init Time ...
3
votes
2answers
391 views

Identity matrix. Confusion. What does it really do

I understand identity matrix is like multiplying to 1. But i can't really understand why would you multiply an a matrix that will only result to the same. Also im messing up with an OpenGL code and ...
1
vote
1answer
153 views

Converting 3 axis vectors to a rotation matrix [closed]

I am trying to get a rotation matrix (in 3dsmax) from 3 vectors that form an axis (all 3 vectors are aligned by 90 degrees each other) Somewhere I read that I could build a rotation matrix just by ...
1
vote
3answers
184 views

Orthographic Projection with variable FOV

We are building agame with orthographic view. The problem we face is the fact that with different resolution you can see different area of the game world. E.g. if you have higher resolution you can ...
1
vote
1answer
101 views

HLSL What you get when you subtract world position from InvertViewProjection.Translation?

In one of NVIDIA's Vertex shaders (the metal one) I found the following code: // transform object normals, tangents, & binormals to world-space: float4x4 WorldITXf : WorldInverseTranspose < ...
12
votes
3answers
846 views

Camera for 2.5D Game

I'm hoping someone can explain this to me like I'm 5, because I've been struggling with this for hours and simply cannot understand what I'm doing wrong. I've written a Camera class for my 2.5D game. ...
2
votes
0answers
99 views

Unproject considering parallax depth

How can I take screen coordinates (or alternatively world coordinates on the 'primary' parallax plane) and find out what world coordinates they translate into when taking parallax depth into account? ...
0
votes
0answers
102 views

Screen space to world space revisited

I am revisiting some code that I thought I understood, but have found that I do not quite understand it. I put together a test to see what was going on. Here's the code: [Fact] public void wtf() { ...
0
votes
0answers
75 views

How do I ADD gravitation to a rotation matrix?

I have ported the Matlab script from https://instruct1.cit.cornell.edu/courses/bionb441/LSystem/ to POV-Ray and everything works fine (although I'm not quite sure why). To navigate a "turtle" through ...
0
votes
0answers
29 views

Is there a transformation or set of transformations that can approximate a “radial scale”?

Is there a way to, with matrices, scale something as if someone were opening a Japanese fan? I'm at a loss of what to call it, so pointers towards avenues of research would be greatly appreciated. If ...
0
votes
1answer
310 views

View Matrix from Camera in Unity Script

I am looking to get a Camera component's "view" matrix in a script. I see that I can get the projection matrix using Camera.projectionMatrix, but I don't see a Camera.viewMatrix property... I want ...
4
votes
2answers
175 views

Precision loss when transforming from cartesian to isometric

My goal is to display a tile map in isometric projection. This tile map has 25 tiles across and 25 tiles down. Each tile is 32x32. See below for how I'm accomplishing this. World Space World Space ...
1
vote
1answer
521 views

Need to translate a Rotation Matrix to Rotation y, x, z OpenGL & Jitter for 3D Game

I am using the Jitter Physics engine which gives a rotation matrix: M11 M12 M13 M21 M22 M23 M21 M32 M33 And I need it so OpenGL can use it for rotation GL.Rotate(xr, 1, 0, 0) GL.Rotate(yr, 0, 1, ...
0
votes
0answers
111 views

Why my camera sees what is behind it?

I am building a minimal opengl viewer and I am puzzled by what I see : the camera see the (test) object that is behind her. the front and back of the camera looks reverted. I am wondering what could ...