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
0answers
9 views

How to find the original top left point coordinate of a rotated rectangle? [closed]

Say there's a rectangle at (20, 20)(fig. 1), then it's rotated 45 degree (fig. 2), if I just have the rotated rectangle and know it's size and rotated degree, is there a way to reverse the rotation ...
1
vote
1answer
69 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
0answers
35 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
40 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
18 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
22 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
58 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
38 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
43 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
31 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
19 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
19 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
39 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
35 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
32 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
37 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
28 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
61 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
222 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
41 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
0answers
18 views

How to align Blender animation to external mesh data?

I'm building a custom engine and I have a confusing asset pipeline. I have skeletal animations in Blender and voxel mesh data in Qubicle. My engine loads the skeletal data and applies joint ...
0
votes
2answers
99 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
52 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
42 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
172 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
30 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
25 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 ...
1
vote
1answer
36 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:...
0
votes
1answer
40 views

Static function is being called, but if statement within is not working

I am trying to make a game where upon the player stepping on a block, the block will change color. I am doing this by using transform.position with the player character being recognized as 1 above in ...
0
votes
0answers
28 views

Move gameObject in its facing direction

I have the following four gameObjects, they have, respectively, the rotations: -90, 0, 90, 180. I want them to move as denoted in the image below This is what I got so far: ...
0
votes
1answer
38 views

Mathf.Round returning wrong values

I want to check if the Y position is changing or not for the player and the enemy. If it has changed in the frame I want it to return true and if it didn't I want ...
0
votes
0answers
35 views

How to store 3D entity position, offset, and transformation data for parent and children?

I am looking for a cleaner pattern to storing character position data, offsets, and transformations. I currently have a character with a vec3 for position. ...
0
votes
0answers
62 views

How to prevent rendered wound from sliding on moving character?

I am trying to display a rendered wound on the character, but I still can't figure out how to display it properly without sliding on character's body. I'm following this link on rendering the wounds ...
0
votes
1answer
37 views

Making sense of the positions of gameObjects

Project files: https://github.com/Sebastian-Nielsen/makingSenseOfPositions Note: There are no scripts running, all I am doing in between each picture is manually changing the x-coordinate in the ...
0
votes
0answers
6 views

getting data from an array stored in a different script Unity [duplicate]

LandingScript w = GetComponent<LandingScript>(); foreach (Transform x in w.Waypoints) { allWaypoints[i] = x; i += 1; } i want ...
0
votes
1answer
71 views

2D engine design/architecture: transformations

Hello! I'm working on this hobby little 2D engine in JavaScript because I want to learn how all this things are implemented and architectured in general. Internet is full of resources but most things ...
1
vote
1answer
167 views

Raycast wrong direction

I use Physics.Raycast and transform.forward to shoot a ray in front of my gameobject, but the ray gets cast downwards instead. <...
1
vote
1answer
72 views

How to align a 3D object with four points?

I'm sure there's a better way to articulate this question, but I lack the vocabulary. Imagine a skateboard. As it rolls straight down a road, the "deck" is aligned with the road, just offset a few ...
0
votes
1answer
52 views

How to calculate the transformation such that two points with different position, orientation and origins line up?

Let's say you have two different 3D Objects which both contain a node that is off center (not at the origin) and have an orientation. How do you calculate the transform for one of the object so that ...
0
votes
1answer
84 views

Calculate Discrete Fourier Transform by using c#

There is a definition of Discrete Fourier Transform: I want to calculate amplitude and phase of a transformed sequence. I tried : ...
0
votes
0answers
16 views

Set parent by property

In the editor's hierarchy, if I drag and drop one object onto another, the second becomes the parent of the first, and moving the parent will cause the child to move. I see I can set this relationship ...
0
votes
1answer
41 views

Nested transform.position in Unity

The following code works so good , but it is so long. How can I use a for loop to write a short script for any number of prefabs? ...
3
votes
1answer
216 views

What does the Node2D transform property do?

Following a Godot tutorial I encountered the transform property, but I'm not sure what it means nor how to use it. I read the official Godot documentation, but it ...
0
votes
1answer
121 views

Creating object in front of player, with some distance

I want to create objects in front of player with some distance, so that prevents hit with player immediately. So first, I get the global player position and direction vector which player towards: <...
0
votes
1answer
33 views

After rotated by Z-axis, X/Y axis still rotating just like z is 0

I'm making aerial vehicle controller, which can rotate 3 axis: X(Pitch), Y(Yaw), Z(Roll). Rotating x(pitch) and y(yaw) axis works fine, however after I rotated z(Roll) axis, x/y rotation gave me ...
0
votes
1answer
27 views

Changing node's translation affects to sibling node

I have a node which looks like this tree: FPSController (Root node, and it's KinematicBody) CollisionShape Camera GroundCheckRayCast When I moved CollisionShape's location down, camera also going ...
1
vote
1answer
135 views

Follow 3D Path Around Sphere

I have currently have a path that wraps around a Sphere from one side to another - this is basically a 3D highway in the sky type object that is a textured road. I have an Aircraft model that I can ...
2
votes
1answer
87 views

What are the “axes of a matrix” exactly?

I am currently learning about game engines, and for the engine math, there are functions called GetXAxis, GetYAxis, and GetZAxis that returned the X, Y and Z axes for a matrix. These functions return ...
1
vote
2answers
189 views

How can I find the offset rotation and position between two objects in 3D?

I have two objects in 3 dimensions, one of them (Child) is attached to the other one (Parent) using the offset between them (XYZ ...
1
vote
0answers
111 views

How to calculate rotations for an object with scaling transformations?

I am working on implementing scaling transformations into a game engine (C++), which previously assumed only translations and rotations. Visually, the scaling works, but a lot of the game logic ...

1
2 3 4 5
9