People who code: we want your input. Take the Survey

Questions tagged [transformation]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
7 views

OpenGL translation based on “scaled” pixels? (Not physical pixels)

My (2D!) game runs in a “scaling mode” so to speak, and I’ve yet to find anyone asking this question anywhere. Basically, I want to achieve a sort of “scaling algorithm” whether graphics are ...
0
votes
0answers
14 views

how to use .getTransform to get the current coordinates of translated/rotating object

I’m stuck trying to figure out how to use .getTransform to determine what pointA (x1,y1) and ...
0
votes
1answer
39 views

How to construct a matrix with the following mapping

How would I create a matrix that maps coordinates like so: Near plane x: [-3,3] -> [-1,1] y: [-6,2] -> [-1,1] z: 2 -> -1 Far plane ...
0
votes
1answer
48 views

How does Unity know where the character is facing?

I just learned Quaternion.LookRotation and it's used for rotating an object. I used it to face my character in the direction where it's moving, but I couldn't ...
0
votes
1answer
53 views

Get world object transform relative to another object (potential parent)

I'm attempting to parent a bullethole decal to a dynamic object. I've figured out how to set the correct position for the bullethole object so that it shows at the correct position of the dynamic ...
0
votes
0answers
16 views

How to project a Matcap correctly in Amplify Shader Editor

Unity's Amplify Shader Editor comes with an example of matcap nodes setup, however, the matcap projection in this example is incorrect. As you can see the texture becomes distorted when it's on de ...
0
votes
0answers
27 views

Rotating a cube with arrow keys

I have a list of rotations (on a cube in 3d space with the y-Axis pointing upwards, x-Axis pointing righthand and z-Axis pointing towards you) for example +90 deg around x-Axis followed by +90 deg ...
0
votes
2answers
89 views

How mesh transformation works under the hood

We can look at the most popular engines like Unity and Unreal engine (maybe Godot and other). As far as I understand (at least I would do this), we store the original mesh, and then for every change (...
0
votes
1answer
25 views

Normalize a rotation around the Z-axis (issue with GLM)

I'm trying to undo some transformations coming from an external tool*. I'm getting different results depending on subtle differences in the input and wondering how to convert to a rotation about the Z-...
0
votes
0answers
17 views

Scaling transforms by time, Eigen Decomposition of Affine Transforms

I posted this question in mathematics, but that sight gets flooded with homework problems... 8 views total, most of them me. Plus, I think this question is more geared to game development anyway. I am ...
0
votes
1answer
16 views

track 2D offset after rotation

red is my origin point, blue is my offset, both are 2D vectors, how can calculate blue after rotation? this is the code I've been trying(just throwing things against a wall to see what sticks) ...
0
votes
1answer
13 views

Mesh does not translate accordingly to WheelCollider

So I am trying to implement a car controller script in Unity were the WheelTransform position and rotation is set with every update as the same as the ...
3
votes
1answer
68 views

My Earthbound-like Movement Script works in Unity Gameview, but runs differently in Gamebuild

First programming question I've ever made in my short journey. I'm trying to create a script which moves members of your party in a line behind you (think Chronotrigger or Earthbound). Here's a clip ...
0
votes
1answer
61 views

Invert parent transform (doesn't work for combination of rotation and scale)

My problem I'm working with Qt3D and my problem is almost exactly like this one: https://stackoverflow.com/q/60995155/3405291 Suggested solution A solution is suggested here: https://stackoverflow.com/...
-2
votes
1answer
29 views

Instantiate prefab on specified position of GameObject on scene

I have a room that I want to connect to a staircase. Both the room and the stairs have the following parameters: I need to "magnet" the "Room Exit" position of the room (start ...
0
votes
0answers
15 views

Rotate an object's scale according camera Y rotation?

I have a circle-shaped object to which I want to apply a scale of 2, 1, 1. Then I would like to rotate this scale according to camera's Y axis. Let me explain with ...
0
votes
0answers
23 views

Is there a way to invert the scaling of the axis and keep the orthogonality?

Recently I ask question and since then been decide to find solution by dividing scale matrix to two part GlobalScale and ...
0
votes
1answer
56 views

How to get correct axis for scaling from transformed space?

I have scaled and non-scaled representation of model so that I don't destroy verticis information if model will be scaled to plane, for example. Now I trying implement scaling on model elements (face, ...
28
votes
1answer
5k views

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

I've downloaded a bunch of (free) 3d warriors with animations. I've noticed for about 25% of them, the 'run' animation physically moves the character forward in the z direction. For the other 75%, the ...
0
votes
1answer
123 views

Where is the Mclip matrix & how do I set it?

According to this article, the Mclip matrix will be used, but I didn't find any function in Directx11 to set this matrix. How do I set it?
0
votes
1answer
29 views

Turning the Turret towards Player Object

I  am trying to turn the enemy turret towards player object using the Armory 3D game engine with Blender. The script is written using Haxe. I am using the following code with both the player object ...
0
votes
1answer
119 views

Why do I get a jitter/stutter when moving and following a target?

I am using the script below to move a transform to quickly follow a target (the player), and come to a stop close to the player. When I move the player around, the transform is following the player, ...
0
votes
0answers
32 views

Unity Transform Origin during Animation

I have a sliding animation on this penguin model which moves the penguin from a standing position to a belly position. During this animation, I've noticed that the object transform origin stays locked ...
1
vote
1answer
78 views

How to avoid destroying information when scaling

I'm in the progress of making a simple 3D editor, just for developing skills on 3d graphics. After implementing some basic tools, I realize that scaling isn't working as I expected. For example, when ...
1
vote
1answer
632 views

How to decompose a 4x4 TRS transformation matrix with negative scale?

As the title says I need to decompose 4x4 TRS transformation matrices and extract the proper scale vectors and the proper rotation vectors (or rotation quaternions). I know how to extract those ...
0
votes
1answer
92 views

Rotate object relative to camera position

I am trying to write code that is able to rotate object, based on camera position. So far I ended up with a code posted below. Moving mouse up and down (y input) caused to rotate object in y axis, ...
2
votes
1answer
86 views

Trying to understand 3D transforms by making an aircraft control script. How would you implement 3D transforms correctly in this example?

I'm struggling to understand 3D transforms in Godot. (I know, I know...) I'm trying my best to implement an aircraft control script, and I've gotten myself into gimbal lock hell. My controls work ...
1
vote
0answers
33 views

Matrix transforming with translation/rotation/scale at center of screen

I'm trying to create a camera using matrix transforms, the gist is as follows: ...
-1
votes
1answer
30 views

How do I modify the coordinates of an object from a script?

I want it to be teleported to a place when it collides with an object and I already have the if the only thing I am missing is a command to modify the coordinates
0
votes
2answers
84 views

How to keep AI goalkeeper inside their bounds

I'm making a soccer-themed top-down 2D endless game, but I have a problem with the goalkeeper AI. My game looks like this: As you can see, the goalKeeper is moving out of bounds. I have tried to ...
0
votes
1answer
369 views

Unity - change transform.localPosition like transform.Translate with Space.Self

I run into the problem with moving object regarding to its rotation. The thing is that I'm changing object position by assigning new transform.localPosition value. ...
0
votes
0answers
44 views

Setting object O2 to have the same geometric relation to P2 as O1 has to P1

I'm trying to place Object O2 with the same relation to P2 that O1 has to P1, like shown in the picture below. This is a problem that I'm facing trying to implement portals in Unreal Engine 4, where: ...
0
votes
1answer
102 views

Unity - Transforming horizontal distance between two spriteRenderers to set UnityEngine.UI.Button width to this distance

In my Unity scene, I have a couple of spriteRenderers and a UnityEngine.UI.Button called ...
0
votes
1answer
30 views

Free camera navigation and pre-defined locations

I have an interactive scenery app written in Unity, where users can freely navigate the camera through the scene. What I want to do now, is to let user automatically fly to some "hotspots" ...
0
votes
0answers
26 views

When using transformation matrices, how does one convert orientation and scaling from a global frame of reference into a local one?

Note: I'm certain I cannot be the first to answer this question. Unfortunately, the answers I need are buried under an avalanche of posts asking how to move coordinates between frames of reference, ...
0
votes
1answer
55 views

How to calculate the dot product between the input direction and a character with root motion?

I need to calculate the dot product between my character movement direction and the input being pressed by the player. When the character movement was being controlled only by code, I was using ...
0
votes
2answers
40 views

How do I bring a child object in its original position after it is translated and rotated?

This is the original position of the cube and its child object cone. Over here, I have translated the cone for 2 units Now I have rotated the parent cube around 25 degrees wrt to the Y-axis If we ...
0
votes
1answer
36 views

How to re-calculate orientation vectors when one of them is being changed?

I want to implement a Unity-like API for my transforms, with the ability to set forward, right, up vectors directly and change object's rotation quaternion accordingly. I got stuck at the math behind ...
1
vote
1answer
57 views

How to change the geometry of the scene in Unity?

I'm trying to experiment with 3D spherical geometry in Unity, but it seems like Unity objects are inherently set in flat space. My first idea was to create a class inheriting from ...
0
votes
1answer
31 views

Position/orient parent to place child at a particular position/orientation

I have a GameObject for which I know its world position and rotation. From another app, I receive a new rotation and position, which should represent the local position and rotation of my GameObject. ...
1
vote
0answers
96 views

My arcball camera does a roll when it shouldnt be

I am trying to build an arcball camera and it's mostly working, the problem is that as you rotate around the object you have selected (orbit_target_pos in the code),...
4
votes
1answer
242 views

How to scale major and minor radius of a quarter torus

I am dealing with quarter tori as in the image below. My issue is that I need to be able to scale its major radius and minor radius separately using a scale matrix. However, when I use a regular ...
1
vote
2answers
43 views

Rotating Cannon's Mouth Toward Player

I am trying to make my cannon mouth rotate towards player, but the rotation is messed up and up I don't know how to fix it. ...
0
votes
2answers
213 views

In practice, is it better to store Euler angles or store three vectors represent as “front/right/up”?

I'm writing a game engine, and when it comes to the transform part, I just use the representation which unity/ue uses, that is: a vector for the position, a vector for Euler angles, and a vector for ...
0
votes
1answer
80 views

What is the signifigance of the Dot Product in World to Local Transformations?

Looking for help understanding why this World to Local Space function works. I'm working my way through Buckland's Programming Game AI By Example The following function is used in the book to convert ...
1
vote
1answer
58 views

Moving a GameObject to a position, waiting, and then moving it again

Hello hello :) Ive been attemping to move a platform (a door basically), and it has partually worked. What works so far is i can move an object from A to B and wait, however it will not move it ...
0
votes
1answer
540 views

Should 3D transformations be represented by a 4x4 matrix or a 3x4 matrix?

Since 3D transformations are represented by 4x4 homogeneous matrices we know that their last row is always (0,0,0,1), and as such the behavior of this final row is implied so long as we know whether ...
0
votes
0answers
50 views

Game Maker - Selecting tiles in an isometric grid

I have implemented an isometric grid with rotation in 2 directions in Game Maker. I did this by first calculating the points of the grid in 3D space and then converting them to 2D points through ...
0
votes
0answers
28 views

Projecting Coordinates from one Space into another, but with “twisting”

i'm trying to generate a decal mesh kinda like this: http://blog.wolfire.com/2009/06/how-to-project-decals/ but instead of projecting the decal with a box, i need to project it with a sort of ...
2
votes
1answer
50 views

Scaling a rotated child with parent-child transforms

In unity, if you parent something to another object, then give the child some rotation, and scale the parent, the scale applies to some arbitrary axis to the child, here's some pictures to demonstrate:...

1
2 3 4 5
9