An array of numbers, symbols or expressions, arranged in row and columns. The numbers, symbols or expressions themselves are called elements or entries.
0
votes
1answer
17 views
3ds max to openGL Matricies
I know this has been asked and answered, and I've read most of them and tried most of them. I must be missing something. And my matrix math isn't very strong. Here are two screen shots, one of 3ds ...
0
votes
0answers
77 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 ...
1
vote
1answer
69 views
what is order of implementation of matrix transforms?
What is the meaning of Tr*Sh*Ro*Sc =M ?
How is matrix M written to form the graphic transformation : 1st Sc=Scale, 2nd: R=Rotate, 3rd : Sh=Shear 4th: T=Translate ?
Is the matrix M above written ...
0
votes
1answer
87 views
switching from third person view to first person view
I have done a scene in opengl where I'm using a third person camera (that I can control with the mouse). Then, inside it, it has the camera of the first view (that I called thirdpersonCamera, see the ...
1
vote
2answers
86 views
Replace glTranslatef and glRotatef with matrixes
I'm not an opengl expert, and, as a novice, I prefer to practice a little bit with the old opengl just to be sure to understand correctly the basic concept of computer graphics before deal with ...
1
vote
1answer
64 views
Combining rotation,scaling around a pivot with translation into a matrix
In short: I need to combine rotation (in the form of a quaternion), scaling around a pivot point along with translation into a transformation matrix.
The long:
I am trying to implement a proprietary ...
0
votes
2answers
90 views
How to properly translate a point by a matrix?
I wrote a simple Matrix class and it has methods like rotate, translate, etc. They all seem to be working, but whenever I try to translate a rectangle using the matrix, the translation axis seem to be ...
2
votes
0answers
57 views
Minimal Projection Matrix
i hope you can help me. I'm currently stuck at the creation process for projection matrices used by shadow maps.
The problem is the following:
I got the spot/directional light ...
-1
votes
1answer
54 views
Last Matrix operation ignored?
I have 2 methods, one to rotate my Quad and one to flip it (using scaleM), they are as follows: (Note, all values in these methods have been properly defined).
If I call just one, they work as ...
1
vote
1answer
112 views
Implementing axonometric bird-view in XNA
I made all kinds of logic (waypath, aso) for my strategical game, based on XNA (monogame).
Now I "misused" the Vector2 a little bit:
As I'm working from a "top-down" perspective, I'm using the Y-axis ...
1
vote
0answers
65 views
Matrix array doesn't seem to get populated
I'm trying to stream an array of matrices to a vertex shader, but it seems that only the first matrix works. What could be the problem? I suspect that I upload the matrices in a wrong way.
C#
...
0
votes
0answers
11 views
Constrain parent node transform to child bounds
If I have some node rendering tree set up, where a node basically has a draw method to render things, and a transform, represented as a 3x3 matrix, with scale and translation.
Now, I would like to ...
1
vote
0answers
40 views
Rotate view matrix based on touch coordinates
I'm working on an Android game where I need to rotate the camera around the origin based on the user dragging their finger. My view matrix has initial position of sitting on the negative z and facing ...
0
votes
1answer
58 views
Trying to convert as3 Matrix to C++ glm matrix
I am trying to convert a library called DragonBones to C++ Opengl which allows you to use Flash based skeletal animation. I'm almost done but I am running into a problem. I am trying to transform the ...
1
vote
4answers
67 views
Storing tile grid in a matrix: row major vs column major
I'm using a generic matrix container to store the tile grid for my RTS game.
This is where I am confused: a matrix is traditionally row major, i.e. matrix(0, 10) means 'at 0th row, 10th column.' A ...
1
vote
1answer
68 views
How can shears/reflections/enlargements be represented by 4x4 matrices? [closed]
I understand that 4x4 matrices can represent transformations on a 3d point (represented as x, y, z, w)
Eg, a translation is
[1 0 0 0]
[0 1 0 0]
[0 0 1 0]
[x y z 1]
where x, y and z are the amount ...
-1
votes
1answer
145 views
Pinhole matrix problem
I made a program to represent a 3D world. I use the projection matrix we can find on wikipedia. For viewing a scene it's very nice but when I straff in the scene, everything behind the camera go on ...
2
votes
1answer
194 views
XNA matrix order problem
I want a matrix that scales first and then rotates. I tried the code below, but it didn't work. zRotation, yRotation and xRotation are rotations that shouldn't be affected by the origin. allrot should ...
2
votes
1answer
57 views
Shear transformation in the projection matrix?
I am trying to understand what the shear transformation (l+r/r-l & b+t/t-b) is actually doing in the projection matrix? The only thing I got till now is headache :) Can you please help?
1
vote
2answers
146 views
Creating a 2D perspective in 3D game
I'm new to XNA and 3D game development in general.
I'm creating a puzzle game kind of similar to tetris, built with blocks. I decided to build the game in 3D since I can do some cool animations and ...
1
vote
1answer
91 views
How to do directional per fragment lighting in world space?
I am attempting to create a GLSL shader for simple, per-fragment directional light. So far, after following many tutorials, I have continually ran into the issue: my light is specified in world ...
4
votes
3answers
117 views
Matrix multiplication - Scene Graphs
I wrote a MatrixStack class in C# to use in a SceneGraph. So, to get the world matrix for an object I am suposed to use:
WorldMatrix = ParentWorld * LocalTransform
But, in fact, it only works as ...
0
votes
1answer
71 views
Common way to store model transformations
I ask myself what's the best way to store the transformations in a model class.
What I came up with is to store the translation and scaling in a Vector3 and the rotation in a Matrix4.
On each update ...
1
vote
0answers
68 views
Premultiplying matrices with Perspective destroys them
If I apply world_to_camera, perspective and camera_to_screen to my mesh, everything is okay. But if I premultiply given matrices (i.e. transform = world_to_camera * perpective * camera_to_screen) ...
1
vote
1answer
51 views
Matrix transforms in XNA
So in my most recent 2D game I draw objects like so.
_spriteBatch.Draw(_sprite, Center(), null, Color.White, _rotation, new Vector2(_sprite.Width / 2, _sprite.Height / 2), _scale, ...
0
votes
1answer
153 views
What is the difference between a modelview-projection matrix and world-view-projection matrix?
So basically I wrote a shader a long time ago that uses all World and WVP matrices. Now I am working in an engine that will only give me access to ModelView, MVP, and model to world space matrices. ...
0
votes
2answers
86 views
Is this Rotation Matrix correct?
I'm having heavly troubles with setting up a View Matrix and a Projection Matrix. It simply doesnt work. So I think my problem is related to my rotationMatrix function. I'm using this tutorial to ...
2
votes
1answer
67 views
Manual GLU.gluUnproject
Before I used GLU.gluUnproject to calculate my picking ray in my OpenGL game. Recently I switched to my own calculated matrices, and now I can forget the gluUnproject.
How can I calculate the picking ...
2
votes
1answer
103 views
Optimising skeletal animation
I am implementing a skeleton system for my latest game. I am using my own linear algebra classes which already have some optimisations, such as separate transformPoint and transformVector functions ...
0
votes
2answers
218 views
OpenGL - Understanding the relationship between Model, View and World Matrix
I am having a bit of trouble understanding how these matrixes work and how to set them up in relation to one another to get a proper system running.
In my understanding the Model Matrix is the matrix ...
2
votes
1answer
93 views
OpenGL Calculate Matrices
Im trying to switch from the glTranslate etc to my own Matrices, but for some reason it does not work. Here are my 2 functions to create the view- and projection matrix:
public Matrix4f ...
0
votes
1answer
105 views
Sharp DX Identity Matrix, Matrix.Forward vector pointing at negative Z
I'm trying to take a steady grip on Sharp DX. Already done some work like translating, scaling and rotating objects. Now i have to calculate the rotation matrix using only direction vector and ...
0
votes
1answer
61 views
What values to construct “Projection Matrix” from?
I am curious to what standard values I should use to create a camera's projection matrix, as well as if certain measurements need to be taken if I want to represent a very small world or a very big ...
0
votes
1answer
89 views
Getting Rotation Values From A Rotation Matrix
I'm trying to get rotation values along the x, y and z axis from a matrix that can include rotation, translation and scale data. Currently I have this function to return the y rotational value:
float ...
2
votes
1answer
139 views
Rotating and Translating a Node in Horde3D with Matrices and Quaternions
I have been trying to learn how to use the Horde3D rendering engine for the past couple of days,
and so far I have managed to learn a decent amount and integrate Bullet Physics with it as well.
My ...
0
votes
1answer
83 views
XNA Camera Positioning All Wrong
I've been working in 3DSMax for years now and decided to give XNA 4.0 a try. I've got the majority of it working, however the camera is being a pain to me and I can't discern what's gone wrong. I ...
3
votes
2answers
136 views
What kind of projection is ScreenX=X/Z, ScreenY=Y/Z?
I have an existing class which transforms 3D vectors and projects them on a 2D plane (Camera). The code is all written in C without help from an external library.
To project a single vector (X,Y,Z) ...
2
votes
1answer
179 views
Negative scale in Matrix 4x4
After some rotations and to from quaternion conversions I get negative scale from Matrix 4x4, is it possible? I need that scale to draw sprite on screen so I get sprite flipped,
how to deal with this ...
2
votes
2answers
140 views
Java Tetris - Matrix Rotations
I'm building Tetris in Java and am trying to use linear algebra to rotate a piece composed of 4 tiles.
My friend was explaining the way to do it is:
He said:
"To clarify, you do need to rotate ...
3
votes
3answers
370 views
Tetris - Rotations using Linear Algebra (Rotation Matrices)
I'm making Tetris in Java and am at the point of rotations... Originally I was hardcoding each rotation:
if (direction.equals("right")) {
if (shape.equals("Bar")) {
if ...
2
votes
1answer
81 views
Translating Viewmatrix is inverted, why?
So I've defined a Projectionmatrix, Viewmatrix and a Modelmatrix using OpenGL (LWJGL).
But when I translate my Viewmatrix to +X it moves my object to the right (hence my camera is moving to the ...
0
votes
2answers
68 views
Transform translation relative to world space
What is common algorithm for translating a transform matrix relative to world space axis?
E.g. Matrix M is representing some local space.
When I want to translate M relative to it's own local axis, I ...
2
votes
0answers
98 views
Box2D, OpenGL, resolution and matrix setup
Okay, my internal units are going to be meters, ranging between 0.1 and 10 meters for size.
First of all, my mind is all wrapped up in a knot trying to understand how to handle my game with multiple ...
2
votes
1answer
118 views
Camera not strafing (GLSL)
I use this code in my GLSL vertex shader, where v_position is the vertex position:
gl_Position = v_position * u_camera;
and set u_camera as follows:
meshShader.setUniformMatrix("u_camera",
...
2
votes
1answer
99 views
transformations of matrices
I'm in the process of reading up on 3d matrices and trying to following this powerpoint and had a few questions as to how to exactly determine the type of transformation from a matrix.
If I have a ...
0
votes
1answer
123 views
Box2D OpenGL debug renderer convert box2d coordinates to world space
I made an OpenGL 3.x renderer for Box2D's debug draw (b2Draw base class). Unfortunately I've tried for a while now to convert the box2D units, which are meters to my internal units which are pixels. I ...
-1
votes
3answers
146 views
Directional light and matrix issues
I'm trying to implement basic directional lightning in OpenGL 3.3 by emulating the logic shown in this guide: http://www.arcsynthesis.org/gltut/Illumination/Tutorial%2009.html
I do not understand ...
1
vote
0answers
73 views
Rotate Points with Object in world space
I posted this in the original stack overflow then realized that a game-dev specific one exists.
I am working on personal project that requires me to have 4 points surrounding an object (1 at each of ...
2
votes
2answers
211 views
World space and model space the dummies version [closed]
I'm by no means a 3d programmer but have recently taken it upon myself to build a Voxel based game and I'm having a little trouble understanding some of the concepts around matrices (what with my ...
5
votes
1answer
141 views
Rotating plane to be parallel to given normal via change of basis
I have two planes and their respective normals. I would like to rotate the second plane, planeB, so that it is parallel to the first, planeA.
To do this, I am using a change of basis to rotate each ...