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
29 votes
1 answer
6k 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 ...
ineedahero's user avatar
0 votes
1 answer
141 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?
Mark Peter's user avatar
0 votes
1 answer
191 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 ...
Murali's user avatar
  • 1
0 votes
1 answer
2k 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, ...
Daniel Lip's user avatar
  • 1,747
0 votes
0 answers
177 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 ...
Lamar's user avatar
  • 101
1 vote
1 answer
100 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 ...
Akros's user avatar
  • 15
0 votes
1 answer
3k 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 ...
andresantacruz's user avatar
0 votes
1 answer
741 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, ...
Ardoos's user avatar
  • 29
2 votes
1 answer
243 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 ...
pocketonion's user avatar
1 vote
0 answers
180 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: ...
Pooper's user avatar
  • 23
-1 votes
1 answer
53 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
GEN4R0's user avatar
  • 1
0 votes
2 answers
288 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 ...
YouCanCallMe Syarif's user avatar
0 votes
1 answer
3k views

Change transform.localPosition to act 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. ...
Ardoos's user avatar
  • 29
0 votes
1 answer
687 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 ...
ChrisC's user avatar
  • 116
1 vote
2 answers
55 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" ...
DannyNiu's user avatar
  • 111
0 votes
1 answer
378 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 ...
Gabriel Minosso's user avatar
0 votes
2 answers
161 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 ...
MrRobot9's user avatar
  • 321
0 votes
1 answer
65 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 ...
IC_'s user avatar
  • 163
1 vote
1 answer
125 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 ...
A. Kriegman's user avatar
0 votes
1 answer
78 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. ...
NoName123's user avatar
1 vote
0 answers
260 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),...
mbl's user avatar
  • 141
4 votes
1 answer
340 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 ...
Ali Kanat's user avatar
  • 143
1 vote
2 answers
60 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. ...
lilly mosling's user avatar
2 votes
2 answers
1k 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 ...
ravenisadesk's user avatar
1 vote
1 answer
381 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 ...
Ty Miles's user avatar
1 vote
1 answer
657 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 ...
ConnnK's user avatar
  • 23
2 votes
1 answer
3k 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 ...
Ryoku's user avatar
  • 187
0 votes
1 answer
1k views

Move camera closer (Zoom In-Out) to object that is being followed

I have implemented a main camera that follows and orbits around an object (player). Now I would like to implement a Zoom In-Out mechanic. This functionality would allows the camera to approach the ...
Western_Hero's user avatar
0 votes
0 answers
245 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 ...
user137's user avatar
  • 443
0 votes
0 answers
32 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 ...
Matthias's user avatar
2 votes
1 answer
333 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:...
DavidColson's user avatar
0 votes
0 answers
111 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: ...
Sebastian Nielsen's user avatar
0 votes
1 answer
70 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 ...
Samuel Fyckes's user avatar
0 votes
0 answers
87 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. ...
kevzettler's user avatar
0 votes
1 answer
250 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 ...
Mira's user avatar
  • 139
0 votes
1 answer
68 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 ...
Sebastian Nielsen's user avatar
0 votes
1 answer
381 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 ...
Eduardo G.R.'s user avatar
1 vote
1 answer
2k 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. <...
TheDoctor's user avatar
  • 113
1 vote
1 answer
278 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 ...
gargantuan's user avatar
0 votes
1 answer
237 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 ...
Nighley's user avatar
0 votes
1 answer
719 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 : ...
vito's user avatar
  • 107
0 votes
0 answers
19 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 ...
user134167's user avatar
0 votes
1 answer
114 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? ...
vito's user avatar
  • 107
3 votes
1 answer
608 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 ...
EmmanCanVaz_95's user avatar
0 votes
2 answers
231 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: <...
modernator's user avatar
  • 1,213
0 votes
1 answer
51 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 ...
modernator's user avatar
  • 1,213
0 votes
1 answer
57 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 ...
modernator's user avatar
  • 1,213
1 vote
1 answer
377 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 ...
JimmyStarr99's user avatar
2 votes
1 answer
1k 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 ...
bob's user avatar
  • 23
1 vote
2 answers
1k 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 ...
Mahmoud Sagr's user avatar

1 2
3
4 5
11