Tagged Questions

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)

1
vote
4answers
2k views

Rotating a model AND translating it forward in XNA

I have this enemy class, and I want it to 1) Spawn at a certain place Vector3 pos 2) Rotate to face my player position 3) Move forward As this code is now, it will appear at it's specified place: ...
5
votes
1answer
385 views

How do I create weapon attachments?

My question is; I am developing a game for XNA and I am trying to create a weapon attachment for my player model. My player model loads the .md3 format and reads tags for attachment points. I am able ...
3
votes
1answer
4k views

Unity3d vector and matrix operations

I have the following three vectors: posA: (1,2,3) normal: (0,1,0) offset: (2,3,1) I want to get the vector representing the position which is offset in the direction of the normal from posA. ...
2
votes
1answer
2k views

Flip rotation matrix

I'm doing character control with kinect. I need to mirror the joint orientation because the character faces the player. Somehow by Googling through internet I've done it and everything works very ...
0
votes
3answers
503 views

Xna Equivalent of Viewport.Unproject in a draw call as a matrix transformation

I am making a 2D sidescroller and I would like to draw my sprite to world space instead of client space so I do not have to lock it to the center of the screen and when the camera stops the sprite ...
1
vote
2answers
840 views

Matrix rotation of a rectangle to “face” a given point in 2d

Suppose you have a rectangle centered at point (0, 0) and now I want to rotate it such that it is facing the point (100, 100), how would I do this purely with matrix math? To give some more specifics ...
5
votes
1answer
1k views

Problem with Assimp 3D model loader

In my game I have model loading functions for Assimp model loading library. I can load the model and render it, but the model displays incorrectly. The models load in as if they were using a seperate ...
3
votes
2answers
596 views

Passing an objects rotation down through its children

In my topdown 2d game you have a player with a sword, like an old Zelda game. The sword is a seperate entity, and its collision box "rotates" around the player like an orbit, but always follows the ...
10
votes
1answer
2k views

Screen space to world space

I am writing a 2D game where my game world has x axis running left to right, y axis running top to bottom, and z axis out of the screen: Whilst my game world is top-down, the game is rendered on a ...
2
votes
1answer
8k views

Transform between two 3d cartesian coordinate systems

I'd like to know how to get the rotation matrix for the transformation from one cartesian coordinate system (X,Y,Z) to another one (X',Y',Z'). Both systems are defined with three orthogonal vectors as ...
1
vote
4answers
5k views

Transform coordinates from 3d to 2d without matrix or built in methods

Not to long ago i started to create a small 3D engine in javascript to combine this with an html5 canvas. One of the issues I run into is how can you transform 3d to 2d coords. Since I cannot use ...
2
votes
2answers
502 views

3D Translation using only distance and angles

So I'm starting to foray into 3D game programming, but I've hit something of a snag. I have an object I want to move around. It should always move either forward or backward relative to its local Z ...
3
votes
2answers
553 views

Trying to understand 2D vector -> projection space conversion

I'm trying to understand how I can transform 2D vectors (x, y) to projection space. Something hasn't quite clicked for me yet. As per my previous question, here's the effect I'm trying to achieve: ...
0
votes
3answers
271 views

Project rendering onto a polygon in the scene

I have a function that renders a simple OpenGL scene. I want to display this scene on a polygon within another scene, without the function having to know about it. For example, to display the scene on ...
6
votes
2answers
2k views

Matrix for 2D perspective

I'm trying to determine whether what I'm attempting to achieve is even possible mathematically. I'm obviously not a seasoned game developer so I'm having trouble even coming up with the terminology to ...
3
votes
1answer
1k views

How do I know if a perspective matrix is right or left handed coordinate system?

For example, if I define my perspective matrix as the following: m[0] = 1.f / ( aspect * focalLength ); m[5] = 1.f / focalLength; m[10] = -zFar / (zFar - zNear); m[11] = -1; m[14] = ...
6
votes
3answers
966 views

Arbitrary projection matrix from 6 arbitrary frustum planes

A projection matrix represent a tranformation from the camera view space to the rendering system clip space. In other words, it defines the transormation between a 6-sided frustum to the clip cube. ...
1
vote
1answer
900 views

Translating local to global coordinates in ARToolkit / OpenGL

Ok, so I've tried reading over the other questions and something's just not clicking for me. I am working on an augmented reality application using ARToolkit, however it should just be straight ...
1
vote
2answers
911 views

Transformation order when dealing with Meshes

I have created a player model out of primitive types. To do this I have created a Model class and Component (mesh) class. Each model consists of one or more components my problems start when you have ...
1
vote
1answer
341 views

How to prevent 2D camera rotation if it would violate the bounds of the camera?

I'm working on a Camera class and I have a rectangle field named Bounds that determines the bounds of the camera. I have it working for zooming and moving the camera so that the camera cannot exit its ...
2
votes
2answers
920 views

What is the difference between Vector2.Transform and this method?

I've been working on some steering behaviors and ran into trouble with my logic for converting points in world space into points in local space. I had this (it's not optimized for multiple points yet, ...
2
votes
1answer
405 views

How do you extract a Vector3 positions only from a world matrix in an array of positions (from Kinect)

've just started building a physical camera class for the depth data you get from a Kinect. I have a Vector3 array of [imageWidth, imageHeight] describing the LOCAL positions I get in from the kinect ...
3
votes
1answer
395 views

Confused about order of operation when using a Matrix in XNA, C#

Here are two different pieces of code This is what I started with Vector2 hold = Vector2.Transform(pos1, mat1); Matrix inv = Matrix.Invert(mat2); Vector2 pos2 = Vector2.Transform(hold, inv); And ...
2
votes
1answer
2k views

How can I use a 3x3 matrix within a 4x4 matrix representation?

In XNA there is only one Matrix class which is actually 4x4 matrix. How to use it to represent a 3x3 matrix? I am trying to represent the inertia tensor of a body which is a 3x3 matrix, so I have ...
2
votes
1answer
422 views

How to linearly transform vertices for large coordinate systems

Alright, so I'm working on a space game and well, I want it to have a lot of space! So I need a large coordinate system and for my rendering pipeline to not suffer from "vertex jittering" due to ...
1
vote
1answer
423 views

Strange 3D game engine camera with X,Y,Zoom instead of X,Y,Z

I'm using a 3D game engine, that uses a 4x4 matrix to modify the camera projection, in this format: r r r x r r r y r r r z - - - zoom Strangely though, the camera does not respond to the Z ...
5
votes
2answers
1k views

What's a pre-multiplied 4x4 matrix?

I'm using a 3d game engine, that uses a 4x4 matrix to modify the camera projection. The matrix is in the regular 4x4 format: r r r x r r r y r r r z - - - zoom The description for the ...
4
votes
3answers
5k views

How to get translation from view matrix

How can I retrieve the camera's world-space position from its view matrix? The only answers I've seen to this question suggest the translation is in the last row/col but this wouldn't work since the ...
2
votes
1answer
456 views

Transformed Pretransformed coordinates?

I am creating a minecraft like terrain engine thing in XNA and C#, and I am trying to create a item/block selector tool. The thing is I would like to have 3D objects on the tool. So I thought for the ...
4
votes
1answer
352 views

Getting the Bounds of a 2D Cameras View with Zoom

I am using a 2D camera, which does rotations and zoom. Currently, I am using the following to get my MinX, MinY, MaxX and MaxY... public float MinX { get { return ...
3
votes
1answer
1k views

Can a 4x4 matrix describe a camera's perspective?

I'm working with a closed-source 3D engine, and it only allows you to set the view projection via a 4x4 matrix. Can this matrix describe the camera's translation, rotation & perspective? I turned ...
2
votes
2answers
1k views

How can I transform a point from world space to object space?

If I have an object space described by transformation matrix that should be applied to object to transform it to world space, what I have to do to transform point (world space) to that object space. ...
2
votes
1answer
679 views

How to create projection/view matrix for hole in the monitor effect

Lets say I have my XNA app window that is sized at 640 x 480 pixels. Now lets say I have a cube model with its poly's facing in to make a room. This cube is sized 640 units wide by 480 units high by ...
7
votes
3answers
1k views

How do I adjust the origin of rotation for a group of sprites?

I am currently grouping sprites together, then applying a rotation transformation on draw: private void UpdateMatrix(ref Vector2 origin, float radians) { Vector3 matrixorigin = new ...
1
vote
1answer
2k views

matrix 4x4 position data

I understand that a 4x4 matrix holds rotation and position data. The rotation data is held in the 3x3 sub-matrix at the top left of the matrix. The position data is held in the last column of the ...
2
votes
1answer
226 views

Translating an object along its heading

Solved! I was not applying the transformations in the proper order. I am working on a simulation that requires me to have several objects moving around in 3D space (text output of their current ...
2
votes
1answer
363 views

How do I build a matrix to translate one set of points to another?

I've got 3 points in space that define a triangle. I've also got a vertex buffer made up of three vertices, that also represent a triangle that I will refer to as a "model". How can I can I find the ...
6
votes
3answers
781 views

Why is my model's scale changing after rotating it?

I have just started a simple flight simulator and have implemented Roll and pitch. In the beginning, testing went very well; however, after about 15-20 seconds of constantly moving the thumbsticks in ...
3
votes
1answer
545 views

Better data structure for a game like Bubble Witch

I'm implementing a bubble-witch-like game (http://www.king.com/games/puzzle-games/bubble-witch/), and I was thinking on what's the better way to store the "bubbles" and to work with. I thought of ...
4
votes
1answer
374 views

UVW: better explanation, and how to implement with GLES texture2D()

UVW texture coordinates, as opposed to UV texture coordinates, do not get very adequate explanation on the web. Many people offer the simple exlanation, "UV is for 2-dimensional textures and UVW are ...
9
votes
2answers
5k views

How can I rotate about an arbitrary point in 3D (instead of the origin)?

I have some models that I want to rotate using quaternions in the normal manner, except instead of rotation about the origin, I want it to be offset slightly. I know that you don't say, in 3d space, ...
4
votes
2answers
851 views

Ara matrices calculated on the GPU or on the CPU? Would built-in matrix functions be faster than my custom ones?

If I add a math library (for example containing a Matrix class) and use it in my program drawing with OpenGL, will my be work slower than if I used standard OpenGL functions for matrix calculations? ...
7
votes
5answers
2k views

Can someone explain the (reasons for the) implications of colum vs row major in multiplication/concatenation?

I am trying to learn how to construct view and projection matrices, and keep reaching difficulties in my implementation owing to my confusion about the two standards for matrices. I know how to ...
6
votes
2answers
1k views

Vector games (Wireframe, Elite-like) theory and implementations?

I'm interesting in knowing more about how vector games like Elite and Star Wars Atari were built from grounds up. The question is not how to implement vector graphics with modern 3D APIs like OpenGL ...
8
votes
3answers
1k views

Should I use a world matrix?

Image reference for the question: (image from the CG tutorial) The D3D9 API got us used to world matrices. However, if you use world matrices, then you have to do an extra matrix multiply in the ...
2
votes
2answers
1k views

How should I calculate world and projection matrices in this scenario?

I'm trying to understand transformation matrices. Suppose I use the camera from this StackOverflow answer, this is how my view matrix would look: Matrix.Identity * ...
2
votes
1answer
546 views

COLLADA: Inverse bind pose in the wrong space?

(Crosspost from StackOverflow) I'm working on writing my own COLLADA importer. I've gotten pretty far, loading meshes and materials and such. But I've hit a snag on animation, specifically: joint ...
0
votes
1answer
861 views

How to find which side of a collider has been hit from hit.normal?

In Unity3d, i can get the normal of the surface with which the collider collides using hit.normal, but is there a way to find which side has been hit what is provided bu Unity3d? One solution is to ...
2
votes
2answers
3k views

gluLookAt vs glTranslate + glRotate and camera transformation matrices

I'm getting my hands dirty in OpenGL and something is bothering me a bit. It's my understanding from reading about the subject that a call to gluLookAt basically multiplies a matrix on the stack that ...
24
votes
1answer
23k views

What is the correct order to multiply scale, rotation and translation matrices for a proper world matrix?

Assume DirectX as the platform, if that is important. (Pretty sure it isn't) Assuming I have a proper scale, rotation and translation matrix, in what order do I multiply them to result in a proper ...