# Tag Info

Accepted

### I'm rotating an object on two axes, so why does it keep twisting around the third axis?

No this isn't an engine bug or an artifact of a particular rotation representation (those can happen too, but this effect applies to every system that represents rotations, quaternions included). You'...
Accepted

### What is the standard practice for animating motion -- move character or not move character?

Animations in which the character translates away from the origin are said to contain "Root Motion" - because the root bone moves. This allows the animator to directly author subtle non-...
Accepted

### Using Quaternions: What can I do with them? (without the maths)

Multiplication At least in terms of Unity's implementation of Quaternions, the multiplication order described in the question is not correct. This is important because 3D rotation is not commutative. ...

### How does a 4x4 matrix represent an object in space and matrix lore?

How is Matrix Multiplication a Transformation? A matrix is just a big grid of numbers with rules that define how we can multiply it with other grids or lists of numbers. In games, we usually want to ...
Accepted

### Why do we need a fourth coordinate to divide by z?

Because if you only divide [x, y, z] by z you get [x/z, y/z, 1] and you lost the actual ...

### Using Quaternions: What can I do with them? (without the maths)

Where's the dot product used? In Unity, one of the most common users of the dot product is whenever you check if two quaternions are equal via == or ...

### How to extract euler angles from transformation matrix?

There's a great writeup on this process by Mike Day: https://d3cw3dd2w32x2b.cloudfront.net/wp-content/uploads/2012/07/euler-angles1.pdf It is also now implemented in glm, as of version 0.9.7.0, 02/08/...

### How and when do the model to world, world to view, et cetera multiplications happen?

Think about it logically: What is your goal when you render something? To display it on the screen! What are the constraints? The model must be visible to the camera (i.e. in the view frustum, not ...
Accepted

### Does vector transformation order matter?

Because of the linearity (aka distributive property) of vector addition and matrix multiplication, it doesn't matter! Yay! ...
Accepted

### LibGDX viewport touch coordinates transformation

I hope I am understanding your question correctly -- if not let me know. I believe the following is where you are unprojecting the coordinates: ...
Accepted

### Do matrix manipulations for 3D graphics ever produce singular matrices?

The simplest way this can happen is if you shrink an object until its local scale in one or more axes is 0 (flattening it to a plane, line, or point). You can avoid this by disallowing scales below a ...
Accepted

### In Unity, how to get reference of descendant?

Yes, transform.Find(name) will only look in the direct children of the current transform. But if you want to get a child deeper in the hierarchy, you can use ...
Accepted

### Is it more efficient to transform vertices on the CPU or the GPU?

In short - it is better to do the transformation on the GPU. Firstly, the GPU is designed to support huge amounts of parallelisation. Your CPU on the other hand is not nearly as capable. The NVIDIA ...
Accepted

### Stop movement if transform.position.y == 0

Because the Y position is never EXACTLY 0. Its for example 5.5 next frame: 4.3 next frame: 3.1 next frame: 1.9 next frame: 0.7 next frame: -0.5 change the if to ...
Accepted

### How to mirror/reflect/flip a 4D transformation matrix

To get a transformation matrix equivalent to the one you have, but reflected across a major axis you can compose it (multiply it by) a reflection matrix. That is, if you have your input matrix M and ...
Accepted

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

You're looking for a change of basis. The way to do it is to find the coordinates of the new basis in the old one. For simplicity, we'll say that the ...

### How can I stop transform.position from being modified when adding a child object?

There is a different way. Instead of: child.transform.parent = parent.transform; Use: ...
Accepted

### what is the very last element of a 4x4 transformation matrix for?

The value is for Homogeneous Coordinates. Using homogeneous coordinates makes it possible to use things like quaternions and projection matrices. The last entire row is actually for dealing with ...
Accepted

### Inline-Building a World (SRT) Matrix

A homogenous transformation matrix (aka a "World matrix") is a 4x4 matrix that defines the translation and rotation of one coordinate system with respect to another. It looks like this: ...

### Unity C# Object Scaling when parenting by script

I'm assuming your question is about the scale change that occurs at the moment you parent one object to another with a net scale other than (1, 1, 1). This can be avoided, as described below. Any ...

### Fastest way to neutralize scale in the transform matrix?

Assuming your matrix multiplication follows the convention... M * v = (T * R * S) * v (where M is your composed matrix, ...
Accepted

### Extract a rotation matrix given a camera direction (vector) and a up vector for the camera?

NOTE: Edited because it was likely too verbose (source). A rotation matrix actually always defines an orthonormal basis. What this means is each column defines one of your original axes in its ...
Accepted

### How to get an game object to instantiate lower than where It's created?

ally = (GameObject) ...is a syntax error. You need to comment this line just like you did the one below it. The problem is on that line, but because it's so ...
Accepted

### Unity / Rotate a point around an arbitrary axis and anchor

The concept of a "rotation" is represented by a Quaternion. These are built into Unity and there's no need for you to understand the math in that link you posted. To create a rotation from an angle &...

### Detect transform from detection of QR code?

Deriving the transformation Note that the transformation of the QR code captured by the camera is a perspective transformation. As such, no amount of affine transformation can emulate it (translating,...