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
0answers
23 views
Proper matrix rotation and storing rotation values
I have GameObject's transform component(position+rotation) and shape mesh(array of vertices).
On each game tick I update coordinates of vertices relatively to game object's rotation.
And my current ...
0
votes
0answers
43 views
opengl projection matrix not working
I'm using opengl es 2.0 on android and trying to get a simple projection matrix working but whenever I try to use it I get a blank screen.
I know my shader compiles fine and if I only send an ...
0
votes
0answers
92 views
+50
How can I create a 2D camera with upscaling and translation?
I've computed a Viewport that is fair in size (a proper aspect ratio to the given device) and then I calculate my ScaleMatrix like so:
scaleMatrix = Matrix.CreateScale(
(float) ...
1
vote
2answers
112 views
What matrix operations do I perform to translate then rotate then translate then rotate?
In an android game I want to draw a running leg. To output the thigh I do something like:
// legCX,legCY is the location on screen about which the leg rotates.
Matrix m = new Matrix();
...
4
votes
3answers
147 views
Mapping 3D object coordinates to 2D screen coordinates with perspective projection
Sort of following on from where this person was in their topic:
Matrix for 2D perspective
What I have at the moment is a transformation matrix that's defined as follows:
http://pastebin.com/GM6BhP0R
...
6
votes
2answers
208 views
How can you extract orientation from a transformation matrix?
I have a 4x4 transformation matrix M, and I want to find out the shape of a sphere when transformed by M. (Sphere is at the origin and has radius 1.)
I know I can find the center by just multiplying ...
0
votes
1answer
43 views
Assigning bone transform in every draw a good idea?
In my Draw method, I am doing the following:
thisMesh.CopyAbsoluteBoneTransformsTo(transforms);
Is this a good idea? Or should I do this once at the constructor level?
1
vote
1answer
107 views
2D Matrix Transformation (with a Player and Ground)
I have a simple game that I'm trying to do for learning purposes, but Matrices are a bit hard, especially in DirectX.
I currently have a tilesystem that renders tiles at the screen and a character ...
0
votes
1answer
85 views
All of my matrix functions not working? OpenGL ES 2.0
I am trying to make a projection matrix scaling the screen and making a coordination system. For some reason I don't think any of my matrix calling is working... the 3 function I am using are
...
2
votes
1answer
108 views
Rotating 3d plane to XY plane
I have a triangle in 3d space and would like to create a grid over the triangle, such as in the image below.
The purpose of this is to store information about each block of the grid. In order to ...
0
votes
0answers
71 views
Stacking Drawing Matrix for SpriteBatch in XNA
I'm trying to make a 2D engine for XNA with SpriteBatch. My object unit is Entity, which can include other Entities as its children. However, when drawing them, the rotation and scaling stacking do ...
2
votes
1answer
78 views
Handling Origin/Anchor Points in a Scene Graph
I'm trying to implement a simple scene graph on iOS using GLKit but handling origin/anchor points is giving me fits. The requirements are pretty straightforward:
There is a graph of nodes each with ...
1
vote
0answers
134 views
How do I implement a physics gun?
I'm currently trying to implement a physics gun for my game. What I want is for the entity to stay in the same position on the screen no matter how I wiggle the camera about, what is the correct way ...
1
vote
1answer
95 views
Is my idea of how to use matrices to layer 2D on top of 3D correct?
I'm new to using matrices, so I'd like some input on whether I've understood the use of them in the context described in the title.
Right now I have a small Direct3D 11-based game engine which ...
0
votes
0answers
129 views
Transformation Matrix in Android Canvas?
This question is following up my previous question that I asked it in stackoverflow: Hide a face of a 3D shape behind another,Android canvas?
I have a canvas and I have to get the normal vector of a ...
0
votes
0answers
36 views
Transform a Screen Delta
I have a delta in screen coordinates that I want to transform to a 3d delta in world space.
The delta is in this case a movement across the (x,y) coordinates in screen space on the near projection ...
1
vote
2answers
134 views
Matrix Rotation with three Angles
I want to rotate a form with three given angles fo each of the three axis. But the GLM rotation function takes only one angle and a vector as arguments.
How can I convert between both formats?
2
votes
1answer
99 views
How attach a model with another model on a specific bone?
I meet a difficulty attached to a model to another model on a "bone" accurate.
I searched several forums but no result. I saw that many people have asked the same question but no real result see no ...
2
votes
0answers
84 views
Scaling along an arbitrary axis (Dealing with non-uniform scale)
I'm trying to build my own little engine to get more familiar with the concepts of 3D programming.
I have a transform class that on each frame it creates a Scaling Matrix (S), a Rotation Matrix from ...
0
votes
0answers
62 views
Camera Projection back Into 3D world, offset error
I'm using XNA to simulate a robot in a 3D world and then do image analysis on what the camera sees.
I have my camera looking down in front of the direction that the robot is going, and I have the ...
1
vote
2answers
138 views
convert orientation vec3 to a rotation matrix
I've got a normalized vec3 that represents an orientation.
Each frame of animation, an object's orientation changes slightly, so I add a delta vector to the orientation vector and then normalize to ...
4
votes
4answers
333 views
Staggered Isometric Map: Calculate map coordinates for point on screen
I know there are already a lot of resources about this, but I haven't found one that matches my coordinate system and I'm having massive trouble adjusting any of those solutions to my needs.
What I ...
0
votes
1answer
89 views
Y Axis inverted on vertex output
I've got my project running and somehow it seems my vertex y components are inverted. 10 in the positive on Y goes down and 10 negative on the Y axis goes up.
I can't find anything with the ...
1
vote
1answer
162 views
How to do geometric projection shadows?
I have decided that since my game world is mostly flat I don't need better shadows than geometric projections - at least for now.
The only problem is I don't even know how to do those properly - that ...
6
votes
1answer
127 views
How can I attach a model to the bone of another model?
I am trying to attach one animated model to one of the bones of another animated model in an XNA game.
I've found a few questions/forum posts/articles online which explain how to attach a weapon ...
4
votes
1answer
91 views
How to transform mesh components?
I am attempting to transform the components of a mesh directly using a 4x4 matrix. This is working for the vertex positions, but it is not working for the normals (and probably not the tangents ...
1
vote
0answers
113 views
Drawing two orthogonal strings in 3d space in Android Canvas?
I want to draw two strings in canvas. The first string must be rotated around the Y axis, for example 45 degrees. The second string must start at the end of the first string and also it must be ...
2
votes
2answers
178 views
How should I organize my matrices in a 3D game engine?
I'm working with a group of people from around the world to create a game engine (and hopefully a game with it) within the next upcoming years. My first task is to write a camera class for the engine ...
6
votes
4answers
249 views
How can I generate a view or projection matrix for OpenGL 3.+
I'm transitioning from OpenGL 2 to OpenGL 3.+ and to GLSL 1.5. I'm trying to avoid using the deprecated features.
My question how do we now generate the view or projection matrix. I was using the ...
0
votes
1answer
118 views
Stage3D: Camera pans the whole screen
I am trying to create a 2D Stage3D game where you can move the camera around the level in an RTS style. I thought about using Orthographic Matrix3D functions for this but when I try to scroll the ...
1
vote
0answers
102 views
Matrix.CreateBillboard centre rotation problem
I'm having an issue with Matrix.CreateBillboard and a textured Quad where the center axis seems to be positioned incorrectly to the quad object which is rotating around a center point:
Using:
...
2
votes
2answers
200 views
The purpose of using invert and transpose
In openGl ES and the World of 3D - why use the invers matrix?
The thing is that I dont have any intuition to, why it is used, therefore please correct me:
As fare as I understand, it is used in ...
1
vote
1answer
70 views
Deformation of Sphere using Transformations
I have a graphic related question. I need to have a transformation matrix that I have no idea about what it is. The problem is to create right image from the right sphere. I created those images in ...
0
votes
1answer
84 views
Camera lookAt target changes when rotating parent node
have the following issue.I have a camera with lookAt method which works fine.I have a parent node to which I parent the camera.If I rotate the parent node while keeping the camera lookAt the target , ...
0
votes
0answers
47 views
Calculating the position of an object with regards to current position using OpenGL like matrices
i have a 1st person camera that collides with walls, i also have a small sphere in front of my camera denoted by the camera position plus the distance ahead. I cannot get the postion of the sphere but ...
0
votes
1answer
62 views
coordinate transformation
I have two coordinate systems, like so
How can I transform a point on the one of the coordinate system to other ?
Pxyz = M . Px'y'z' what is M ?
1
vote
0answers
110 views
How do I convert my matrix from OpenGL to Marmalade?
I am using a third party rendering API, Marmalade, on top of OpenGL code and I cannot get my matrices correct. One of the API's authors states this:
We're right handed by default, and we treat y ...
-1
votes
2answers
183 views
How can I reflect a point with respect to the plane?
How can I reflect a point with respect to a plane?
Example:
I have three points (0,0,2), (4,0,0) and (0,8,0). And I have a point (x,y,z). From these, I want derive a composite transformation matrix. ...
0
votes
1answer
88 views
How to Draw texture between 2 Vector3
My scenario:
RTS combat style, 1 unit fires beam on another unit
My problem is i want to draw a flat texture between 2 Vector3 points. I have looked at various Billboarding styles but that doesn't ...
2
votes
1answer
635 views
How does gluLookAt work?
From my understanding,
gluLookAt(
eye_x, eye_y, eye_z,
center_x, center_y, center_z,
up_x, up_y, up_z
);
is equivalent to:
glRotatef(B, 0.0, 0.0, 1.0);
...
2
votes
1answer
170 views
Movement on the X an Z axis are combined?
This is probably a stupid question, but I'm trying to simply move a 3D object up, down, left, and right (Not forward or backward).
The Y axis works fine, but when I increment the object's X position, ...
38
votes
7answers
3k views
Why do we move the world instead of the camera?
I heard that in an OpenGL game what we do to let the player move is not to move the camera but to move the whole world around.
For example here is an extract of this tutorial: OpenGL View matrix
...
2
votes
1answer
142 views
Billboarding restricted to an axis (cylindrical)
I have succesfully created a GLSL shader for a billboarding effect. I want to tweak this to restrict the billboarding to an arbitrary axis, i.e. a billboarded quad only rotates itself about the ...
3
votes
2answers
372 views
How can I implement smooth rotation from one direction to another?
I'm having a problem with animating rotations with 1Matrix.CreateRotationY() with my basic 3D game. Based on where you click the mouse, I want the 3D object to rotate to that direction and then move.
...
3
votes
2answers
211 views
3D rotation matrices deform object while rotating
I'm writing a small 3D renderer (using an orthographic projection right now).
I've run into some trouble with my 3D rotation matrices. They seem to squeeze my 3D object (a box primitive) at certain ...
1
vote
1answer
237 views
how can i get rotation vector from matrix4x4 in xna?
i want to get rotation vector from matrix to realize some parent-children system for models.
Matrix bonePos = link.Bone.Transform * World;
Matrix m = Matrix.CreateTranslation(link.Offset)
* ...
0
votes
0answers
150 views
Unity3D - Projection matrix camera frustum
I've used off centre projection to create a custom projection matrix for my camera.
When I run the game I can see the scene correctly in the game view but in the editor view the camera frustum is not ...
0
votes
1answer
234 views
Building View Matrix in Direct3D11
Am I doing it right? I converted this.
m_ViewMatrix = XMMatrixLookAtLH(XMLoadFloat3(&m_Position), lookAtVector, upVector);
to this one.
XMVECTOR vz = XMVector3Normalize( lookAtVector - ...
0
votes
2answers
290 views
OpenGL, objects disappear at a certain z distance
I'm writing a managed OpenGL library in C++, and I'm having a pretty annoying problem. Whenever I set an objects Z coordinate to -2.0 or lower, the object disappears. And at coordinates 0 through ...
3
votes
1answer
91 views
How to make an object stay relative to another object
In the following example there is a guy and a boat. They have both a position, orientation and velocity.
The guy is standing on the shore and would like to board. He changes his position so he is ...