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

learn more… | top users | synonyms

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 ...
0
votes
0answers
36 views

Relative Transformations for Bones

I'm using Blender to export my armatures in relative coordinates, and I'm trying to get to absolute coordinates in my engine. For the above example, the childBone's tip is an offset of [-1,0,0], ...
0
votes
1answer
73 views

OpenGL not rendering full scene, it is a mystery [closed]

I am trying to draw a scene in the sort of style of mock vector graphics. I've helped on a 2D game before with GLSL, but I tried to keep a simple approach to this project since I'm working by myself, ...
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 ...
0
votes
0answers
41 views

How to translate vertex buffer coordinates in 2D

I am trying to (using a 2D Directx9 engine library) rotate/translate a set of points in a vertex buffer. I understand how this would be done in a 3D system - i.e using the vertex shader stage of ...
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 ...
3
votes
2answers
764 views

Realtime fisheye to cubic or spherical panorama transformations with OpenGL or pixelshaders

I'd like to transform a sequence of circular fisheye-images to cubic or spherical panorama images to be used in a panorama-viewer based on OpenGL. The viewer-part is nemas problemas but the transform ...
2
votes
1answer
52 views

Distort a quad with a World Matrix

Is it possible to distort a quad multiplying its vertices by a specific world matrix? See the picture to understand what kind of distortion I need: Please note, that the quad is in 3d space and I ...
1
vote
1answer
4k views

How can I translate a game object towards a position?

I am instantiating my game objects (spheres) through scripts. I want my spheres to move from one location to another. but I don't know how to do this. Update is called once per frame. Is that what I ...
0
votes
1answer
173 views

How do I rotate and flip 2D sprites stored in a 1D array of pixels?

I am using a 1D array of pixels for rendering in 2D in java. I am interested in rotation (in radians) and mirroring across the x and y axes. The desired result looks something like this: Public void ...
1
vote
1answer
32 views

Camera world matrix to view matrix

I've been working on a game engine and I model every object in my scene graph as an "entity" this includes my camera. My camera therefore has a position and rotation in world space and at the moment ...
0
votes
1answer
389 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 ...
4
votes
1answer
93 views

How do I deal with floating-point error given a far-away camera?

Whenever a camera is "far" away (its location is some "large" vector), trouble arises when rendering objects close to it: It is the classic precision loss from subtracting 2 floating point numbers. I ...
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, ...
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 ...
3
votes
1answer
397 views

Transform world space using Kinect FloorClipPlane to move origin to floor while keeping orientation

The Kinect SDK provides a property SkeletonFrame.FloorClipPlane that describes the orientation of the floor plane relative to the camera. MSDN contains slightly more information in the Coordinate ...
0
votes
1answer
62 views

When and how to apply affine translations to vertices of a mesh with LWJGL

So, I have a rigid body class, containing a list of vertices and a 4x4 transformation matrix. At the moment, I'm applying the transformation matrix to each vertex individually, and am unable to revert ...
0
votes
1answer
106 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 ...
2
votes
1answer
288 views

How do I make my camera follow a Box2D object?

I'm implementing a camera in my game. It worked for regular objects, but I began using Box2D and obviously things changed a bit. I have a Body object that I want to draw at the center of the screen. ...
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 ...
2
votes
1answer
343 views

Generating transformation matrix for 2D camera with pan/zoom/rotate

Question How do you implement a camera with pan/zoom/rotation for a 2d game? Is it acceptable to multiply together a series of transformation matrixes to generate a final transformation matrix that ...
1
vote
2answers
94 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
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
votes
2answers
62 views

GLSL Normals not transforming propertly

I've been stuck on this problem for two days. I've read many articles about transforming normals, but I'm just totaly stuck. I understand choping off W component for "turning off" translation, and ...
0
votes
1answer
232 views

How do I rotate a sprite with ccbezierTo in cocos2d-x?

In cocos2d-x, I move a sprite with ccbezierTo like this: // use for ccbezierTo bezier.controlPoint_1 = ccp(m_fish->getPositionX() + 200, visibleSize.height/2 + 300); bezier.controlPoint_2 = ...
0
votes
0answers
107 views

Zooming in isometric engine using XNA

I´m currently working on an isometric game engine and right now I´m looking for help concerning my zoom function. On my tilemap there are several objects, some of them are selectable. When a house ...
1
vote
1answer
184 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 ...
0
votes
0answers
39 views

How can I transform one triangle into another triangle with HTML5 Canvas? [duplicate]

Given a triangle I'm searching for the canvas transformation to transform it into an other Triangle with the corner coordinates (A,B,C) Input triangle: Red Triangle: A'=(0,0) B'=(80,80) C'=(0,80) ...
3
votes
1answer
154 views

What are the performance and size tradeoffs of Eigen::Transform versus Eigen::Matrix4f?

We finished migrating from DirectXMath to the Eigen math libraries for our 3D-Game Engine last week for portability reasons. After implementing transformations with matrices as we know them, we found ...
1
vote
2answers
167 views

How can I make EaselJS' skew behave like canvas'?

The skew property of a bitmap in EaselJS (given as angle) rotates the image such that it also flattens. I'd like to skew it without "squashing" it, as canvas does. JSFiddles, to demonstrate: Canvas ...
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
85 views

How can I make an attached gameobject behave correctly on character flip?

I have a character that on start-up is equipped with another gameobject/prefab as a weapon, attaching it to a hand. void Start() { handFront = transform.Find ...
2
votes
2answers
233 views

How can I determine the pixels covered by a transformed triangle (without drawing it)?

I have three points that form a triangle in a 3D scene. I want to apply an arbitrary rotation/translation transformation to this polygon and later check in which pixels of an image they would be ...
5
votes
1answer
240 views

Are there multiple valid definitions for what translate, rotate and scale do?

Are there multiple valid definitions for what translate, rotate and scale do to the 4x4 matrix? I bring up this question, because I have a simple webgl program that draws a square and does a few ...
0
votes
0answers
61 views

Rasterizing euclidean planes

I'd like to visualize a BSP tree. To do this, I need to project an arbitrary euclidean plane onto a projection plane. I was thinking about calculating the intersections of the plane with the viewing ...
1
vote
2answers
7k views

How do I make a background fill the whole screen in Libgdx?

I'm using this code to set a 800x420 image to be full screen: public void show() { float w = Gdx.graphics.getWidth(); float h = Gdx.graphics.getHeight(); camera = new ...
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); ...
3
votes
1answer
92 views

How can I GL_SELECT from a gluPerspective-transformed scene?

I'm using JOGL to access OpenGL-methods on an old OpenGL version, because of school. I have written a method which is called before any objects are drawn. This method shows which object is picked. ...
0
votes
2answers
354 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
0answers
93 views

How to convert bones skeleton into joints skeleton?

I'm exploring skeletal animation and taking Half-Life SMD format as example. It has skeleton rigged as hierarchy of joints. Each joint has a parent and offset + rotation to it. Now I'm importing ...
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 ...
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 ...
2
votes
2answers
188 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
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 ...
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
252 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
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 ...
4
votes
2answers
298 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 ...