Transformation in game development is usually refers to linear algebra operations on points, vectors and matrices.

learn more… | top users | synonyms

1
vote
1answer
63 views

changing coordinate system

I'm currently trying to transform a system by scaling it on x and y axis and have some uncertainty. I have the general concept that scaling works as such: My original box has corners at (0, 0) and ...
1
vote
1answer
301 views

Canvas isometric translations to integer coordinates

I'm creating a canvas based game with an isometric playing board. I use the following transformations to get my square tiles to render on the screen: 'applyViewportTransformation' : function() { ...
1
vote
2answers
2k views

Render rotated rectangle inside other rectangle bounds using Libgdx

I have this code to generate a red rectangle inside a grey rectangle: new Rectangle(grey_rectangle_position_x, Game.SCREEN_HEIGHT/2-Rectangle.height/2,0); This code makes the following: Now, I ...
1
vote
1answer
902 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
1answer
26 views

Error in plane transformation

I have a bunch of coplanar points, who sit on plane P. I want to translate the plane to Q with the points upon. Here is what I do: I take three points from P, say a, b, c. Their centroid is denoted ...
1
vote
1answer
63 views

How do I combine matrix transformation with non-uniform screen scaling in Flash?

I'm using a Flash transformation matrix for affine transformation. I have a rectangular image being rotated and scaled (in 2D). There are two sets of scaling variables, ScreenScaleX and ScreenScaleY, ...
1
vote
1answer
61 views

Matrix transformation

I have to find components of a matrix for 3D transformation. I have a first system in which transformations are made by multiplying: M1 = Scale x Rotation x Translation. I want to have the same ...
1
vote
2answers
93 views

Do I need to store a generic rotation point/radius for rotating around a point other than the origin for object transforms?

I'm having trouble implementing a non-origin point rotation. I have a class Transform that stores each component separately in three 3D vectors for position, scale, and rotation. This is fine for ...
1
vote
1answer
182 views

How to project spherical coordinates to canvas

I have objects with coordinates in a spherical coordinate system (altitude alt and azmiuth az). I want to project those to my canvas with a given size (128 x 128 pixels²) and resolution (about 6 ...
1
vote
1answer
172 views

How to rotate vertices of 2D shape using a transform matrix?

I am making a top-down 2D game and am currently working on implementing improved collision using SAT. I programmed a Shape class with a Vector2 center that is its position in world space. On top of ...
1
vote
1answer
104 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 ...
1
vote
1answer
82 views

Picking problem with rotated view matrix

I have picking code that works, if my view matrix has no rotation (only translation). Now If I rotate my camera, picking goes to hell. I cant find whats wrong My code: ...
1
vote
1answer
188 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
vote
1answer
199 views

How to calculate the Screen Position of a bounding sphere/box?

Synopsis: What I have is an object rendered on the screen. I need to calculate the top-left / bottom-right of it's location on the screen in Screen Coordinates. Explanation: The object is ...
1
vote
1answer
166 views

Proper approach to handle transformation matrix and extract its components

Basically I have a Transformation component object with following structure(pseudo): TransformComponent{ Vec3 position; Vec3 rotation; //in euler angles Vec3 scale; Mat4 worldMatrix; ...
1
vote
1answer
207 views

SimpleOpenNI: Check if user hand is in specific area on image

Concerning our Microsoft Kinect project, we need some help. We control a robot with our movements tracked by the Kinect sensor. We display the depth image of the Kinect sensor on our screen, so we ...
1
vote
1answer
160 views

Orthogonal projection and world transform

I'm reading about projection matrix. Needs of perspective projection is obvious, but I'm not sure about orthogonal projection. Because orthogonal projection effect looks possible with only world ...
1
vote
1answer
496 views

Transform 3d viewport vector to 2d vector

I am playing around with 3d transformations and came along an issue. I have a 3d vector already within the viewport and need to transform it to a 2d vector. (let's say my screen is 10x10) Does that ...
1
vote
1answer
245 views

How do I draw shape distortion with a Texture2D in XNA?

Say I have a rectangular Texture2D object in XNA, and I draw it on the screen. How can I animate it so it slowly changes to a trapezoid shape, and then to a pentagon, etc. I have no idea what this ...
1
vote
1answer
2k views

How to stop transform.position from being modified when adding child object in Unity

I suspect there is a well-known and easy to explain reason for the behavior I'm seeing, but I am having difficulty explaining it. (And likely not able to Google for the answer.) When adding a child ...
1
vote
1answer
466 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 ...
1
vote
1answer
594 views

importing animations in Blender, weird rotations/locations

This is for the Blender 2.6 API. There are two problems: 1. When I import a single animation frame from my animation file to Blender, all bones look fine. But when I import multiple (all of the ...
1
vote
1answer
250 views

World to Pixel Transformation

My objects have a location in world coordinates (basically 1.0f is a meter). If I simply draw my objects using their world coordinates, each meter will correspond to a pixel. Obviously that's not what ...
0
votes
2answers
224 views

OpenGL: Transformations

I'm not sure if I correctly understand 3D transformations in OpenGL. Let's assume I'm using the typical matrix stack. It seems like you move the world X units over, drop in a bag of verts (a mesh) ...
0
votes
1answer
129 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 ?
0
votes
1answer
187 views

Build unity like Transform class [closed]

I am building a Unity-like Transform class. This is my header file: #include "Common.h" struct Transform { public: Transform(); void Translate(float x, float y, float z); ...
0
votes
2answers
216 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 ...
0
votes
1answer
93 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 ...
0
votes
1answer
674 views

Rotation of Rectangle along Y-axis transformed to parallelogram

After the rotation of a rectangular view along the Y-axis, about its center, transformed into parallelogram, how do I get the rotated parallelogram coordinates? By Y-axis, I mean perpendicular to the ...
0
votes
1answer
449 views

Optimizing hierarchical transform

I'm transforming objects in 3D space by transforming each vector with the object's 4x4 transform matrix. In order to achieve hierarchical transform, I transform the child by its own matrix, and then ...
0
votes
1answer
105 views

How are 2D transformation matrices applied to their targets?

I understand mathematically how transformation matrices work, in that a transformation matrix multiplied by a vector results in a new vector, and we use the matrices for rotation, translation, etc. I ...
0
votes
2answers
115 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 ...
0
votes
1answer
983 views

Interpolating a player between two 2D points?

I would like a player to be able to move in a direction smoothly, whilst sticking to a fixed grid. Much like in Pokemon, how the player can move, but when the key is pressed and released quickly, they ...
0
votes
1answer
75 views

How to change Vectors due to change in it's dependent Base Vector?

PLOT : I have been developing a game where the player falls down on Y axis and the camera is a Top-Down view camera. The camera, player (main character in the game) movements etc. have all been ...
0
votes
1answer
26 views

Can't figure out projection transform

I'm trying to fugure out all the spaces transformations, and currently have some inconsistency I can't understand. I'm working on a 2D game (so we assuming Z is always 0 for now), on a device with ...
0
votes
1answer
374 views

Simultaneously translating and rotating sprite in Unity

I have a 2D object (a PNG file I dragged onto the screen) which is a circle I would like to move left and right when the correct side of the screen is touched and have it rotate in the respective ...
0
votes
1answer
33 views

transformation before the perspective divide but after projecting perspectively

My problem is that I would like to confine a scene render to a (possibly rotated) rectangle without using glViewport(). I don't want to use it to save, if possible, some cycles that would otherwise be ...
0
votes
2answers
353 views

DirectX11: Drawing multiple objects

How can I draw many different objects on screen at once, with multiple vertex buffers, using DrawIndexed()? (Drawing the same object is simple, and I'm not looking to instance) ...but I am looking ...
0
votes
3answers
194 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
76 views

Displaying normals of a geometry

I have a rectangle which is created by 2 triangles and it is in x-z plane, and i have object on it. Now, the normals of two triangles (face normals) are y axis i.e. (0,1,0). I want to display normals ...
0
votes
1answer
2k views

rotating 3D object around the center

I have object moving from A to B on x-axis and there is no translation of object apart from it. Now, while moving, i want to rotate it around y-axis and the motion should change accordingly, i mean if ...
0
votes
1answer
233 views

OpenGL camera translate and rotate on cameras local axis

How can I make rotation and translation on a local camera axis in OpenGL? I want to make camera like "aeroplane" camera with a pitch yaw and roll. I want to have good explanation on everything! Can ...
0
votes
1answer
250 views

Rotate/Translate object in local space

I am just trying to create a movementcontroller class for game entities. These class should transform the entity affected by the mouse and keyboard input. I am able to calculate the changed rotation ...
0
votes
1answer
329 views

Apply bone tranforms when importing FBX in XNA

Preconditions: I have some models, that does only contain some meshes and one texture. There is no animation within the model. An example: a model of a table. I want to draw the Model with a custom ...
0
votes
2answers
358 views

3d vertex translated onto 2d viewport

I have a spherical world defined by simple trigonometric functions to create triangles that are relatively similar in size and shape throughout. What I want to be able to do is use mouse input to ...
0
votes
2answers
563 views

getting bone base and tip positions from a transform matrix?

I need this for a Blender3d script, but you don't really need to know Blender to answer this. I need to get bone head and tip positions from a transform matrix read from a file. The position of base ...
0
votes
2answers
5k views

Scaling Model in XNA, keep position

I am trying to create a little fun 3D game in XNA, but I am having some problems with scaling my models. I use models from random sites, so my battleship is for an example 10 times larger than my ...
0
votes
0answers
27 views

Translate click on screen to point on plane in 3D space

I am creating a 2.5D game with the camera at a slight angle, like so: The grid is the "playing field," and the positive x, y, and z directions are labelled. I already know all the details about ...
0
votes
0answers
22 views

Instantiating and deleting objects with triggers problem

I'm trying to create some kind of dust field, by now I'm just creating small balls for testing, between the bounds of a BoxCollider which I use as my dust field. When the box collider goes outside the ...
0
votes
0answers
12 views

In libgdx, how do I get the intersection of a ray with a model instance?

I am using LibGDX trying to use raypicking to pick a point on a Mesh. I have two methods for this that don't seem to work quite right: /** * @param ray * @param intersection The vector to store ...