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

learn more… | top users | synonyms

50
votes
9answers
12k 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 ...
10
votes
1answer
501 views

Special relativity shader in GLSL

I'm trying to implement a GLSL shader which helps understanding special relativity Lorentz Transformation. Let's take two axis-aligned inertial observer O and O' . The observer O' is in motion w.r.t ...
7
votes
2answers
823 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 ...
6
votes
3answers
526 views

Transforming a primitive tetrahedron into a primitive icosahedron?

I've created a tetrahedron by creating a BoundingBox and building the faces of the tetrahedron within the bounding box as follows (see image as well): VertexPositionNormalTexture[] vertices = new ...
6
votes
1answer
466 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 ...
5
votes
1answer
205 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 ...
4
votes
2answers
832 views

How is the gimbal locked problem solved using accumulative matrix transformations

I am reading the online "Learning Modern 3D Graphics Programming" book by Jason L. McKesson As of now, I am up to the gimbal lock problem and how to solve it using quaternions. However right here, ...
4
votes
2answers
177 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 ...
3
votes
2answers
214 views

Calculating transform of arrow model pointing at some point in 3D space

I'm working on a 3D flight game and I'd like to implement a simple "navigation arrow" pointing at the next waypoint in world which the player has to fly to. I have position of both airplane (=camera) ...
3
votes
1answer
143 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?
3
votes
1answer
165 views

Sfml: Sprite scale transformation animation

Is there any way to animate a transformation on sf::Sprite like setScale or setPosition? ie: sprite.setScale(0.5f,0.5f);. I want the transition between normal and half scale be smooth. Thanks!
3
votes
1answer
42 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. ...
3
votes
1answer
159 views

Extract derived 3D scaling from a 3D Sprite to set to a 2D billboard

I am trying to get the derived position and scaling of a 3D Sprite and set them to a 2D Sprite. I have managed to do the first part like this: var p:Point = sprite3d.local3DToGlobal(new ...
3
votes
1answer
135 views

Calibration of a 6 DOF tracking device

Setting: In our facility we have a 3D laboratory with 3 large displays (two edge-to-edge on orthogonal walls, one on the ground, also edge-to-edge). Its primary use-case is exploring 3D virtual ...
2
votes
2answers
181 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: ...
2
votes
1answer
371 views

The View-Matrix and Alternative Calculations

I'm working on a radiosity processor in DirectX 9. The process requires that the camera be placed at the center of a mesh face and a 'screenshot' be taken facing 5 different ...
2
votes
2answers
117 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 ...
2
votes
1answer
113 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 ...
2
votes
1answer
218 views

Transformation matrix that maps a window

I'm currently learning OpenGL at uni, and they give us questions to help us learn (these are not worth anything), however I'm stuck on this one question and would have to travel over an hour and a ...
2
votes
1answer
3k views

How to extract euler angles from transformation matrix?

I have a simple realisation of entity/component game engine. Transform component have methods to set local position, local rotation, global position and global rotation. If transform is being set new ...
2
votes
1answer
137 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 ...
2
votes
1answer
562 views

OpenGL: Move camera regardless of rotation

For a 2D board game I'd like to move and rotate an orthogonal camera in coordinates given in a reference system (window space), but simply can't get it to work. The idea is that the user can drag the ...
2
votes
2answers
292 views

Split up a screen into regions

My task: I want to split up a screen into 3 regions for buffs-bar (with picked items), score-info and a game-map. It doesn't matter are regions intersect with each other or not. For example: I have ...
2
votes
1answer
285 views

Rotate 2D Isometric World

Games like RollerCoaster Tycoon allow you to rotate the view at 90 degree intervals. I'm wondering how I could apply this to a game I'm making. I'm using MonoGame... but I'm wondering more if anyone ...
2
votes
2answers
408 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
417 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 ...
2
votes
1answer
59 views

How to transform a subset of a vertex in a vertex buffer?

float linePos[6]={0.0f,5.0f,0.0f,0.0f,30.0f,0.0f}; ... glGenBuffers(1, &buffer); glBindBuffer(GL_ARRAY_BUFFER, buffer); glBufferData(GL_ARRAY_BUFFER, sizeof(float)*3*2, linePos, ...
2
votes
1answer
293 views

Transform 3D vectors between coordinate systems

I've got 6 points in 3D space: A,B,C,D,E,F, that represent 4 vectors. AB is perpendicular to AC and DE is perpendicular to DF. I need to find a transformation matrix M, that transforms AB to DE and ...
2
votes
2answers
253 views

how to transform child elements position into a world position

I'm making a 2d space game in Javascript with canvas. In this game there's a bunch of spaceships, positioned in world space, with turrets, positioned relative to their parent ships. These objects also ...
2
votes
1answer
206 views

Transforms in Box2D

I'm attempting to implement a camera in my game. I had it working 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 ...
2
votes
1answer
368 views

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
3answers
304 views

Inverting matrix then decomposing gives different quaternion than decomposing then inverting the quat

I'm getting different signs when I convert a matrix to quaternion and invert that, versus when I invert a matrix and then get the quaternion from it: Quaternion a = Quaternion.Invert(getRotation(m)); ...
1
vote
2answers
642 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. ...
1
vote
2answers
341 views

Transforming bounding spheres

When testing bounding spheres as part of the collision detection process, I'm using this method: public static BoundingSphere TransformBoundingSphere(Matrix m, BoundingSphere b) { var ...
1
vote
3answers
975 views

In Maya how do I convert trans, rot, scale data to a 4 x 4 transformation matrix?

I have been given the following Maya camera data: trans X: 1.542 trans y: 3.319 trans z: -1.821 rot X: 117.882 rot Y: 2.189 rot Z: 154.074 scale X: 1 scale Y: 1 scale Z: 1 What is the ...
1
vote
1answer
506 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 ...
1
vote
1answer
141 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 ...
1
vote
1answer
400 views

Translate along local axis

I have an object with a position matrix and a rotation matrix (derived from a quaternion, but I digress). I'm able to translate this object along world-relative vectors, but I'm trying to figure out ...
1
vote
1answer
48 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 ...
1
vote
1answer
98 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 ...
1
vote
1answer
61 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
271 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
1k 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
792 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
53 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
64 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
148 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
137 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
143 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
173 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 ...