Questions tagged [transformation]
Transformation in game development is usually refers to linear algebra operations on points, vectors and matrices.
537 questions
0
votes
1
answer
135
views
In game engines and 3D rendering, which coordinate system results in the least amount of operations to transform and render scenes?
I understand this is a slightly esoteric question, but its something I've constantly asked myself over and over when using various 3D design tools and game engines.
In what way should models be facing,...
3
votes
1
answer
138
views
What is this rotation/translation tool thingy called?
I am currently working on filling out some tasks for a task board and I realized I have no idea what this thing is called. It's an axis thingy that you can grab to translate and rotate an object. I ...
1
vote
1
answer
70
views
Gizmo scaling with arbitrary reference coordinate system
I am currently implementing gizmos in my engine (or rather continuing the implementation I made a year ago). I had implemented a way to choose whether transformations are applied based on local space ...
0
votes
0
answers
121
views
Why does this code behave strangely with different camera angles?
Relevant to this issue are two MonoBehaviour scripts: Actor and Player. ...
1
vote
1
answer
108
views
Adjusting movement vector for converting to input vector in an isometric game
I am currently modding in keyboard and mouse support for a Unity game that only supports controllers. The game is in an isometric style, and as such, the game camera is slightly tilted. The original ...
0
votes
0
answers
65
views
GPU-friendly coordinates for hyperbolic geometry
Perspective Euclidean rendering makes use of the W coordinates in a 4-component vector by recording distance information into it and let GPU do the scaling/normalization.
Hyperbolic and non-Euclidean ...
0
votes
1
answer
161
views
Is the "View transform" just a change of basis matrix + a translation applied to each point? (to bring them into camera space)
I am learning about the graphics pipeline. My understanding of the view transformation is that you:
First create a normalized, separate coordinate system for the camera, based on its position and ...
0
votes
0
answers
74
views
Iterative Rotation, Translation, and Scale Around Pivot
I'm coding a VR application that allows the user to point the controller at an object (there's a "laser" the extends from the front of the controller and is used in hit testing) and adjust ...
0
votes
0
answers
38
views
How to Achieve the Same Object Rotation [duplicate]
How can I achieve the same object rotation as in this video? I can't figure out how this type of rotation is implemented. Where should I start looking? As far as I understand, after the rotation, the ...
0
votes
1
answer
90
views
Have enemy move toward player when spawned
Have an basic enemy prefab that when spawned, I would like it to lock to player and move toward them, with smooth rotation. However, as you can see in this video, the enemy initially moves away from ...
2
votes
0
answers
84
views
How to convert a quaternion to another coordinate system where y and z are inverted?
I have quaternion representing a camera pose in a coordinate space called "World Frame 2":
x+ = right
y+ = up
z+ = out
...and I want to convert it to another space called "World Frame ...
0
votes
0
answers
48
views
localPosition for UI object gives different results from its values in the script
Here is my script for opening animation. It basically sets the localPosition of an object out of the screen and then brings back in smoothly. The problem is I got ...
0
votes
2
answers
96
views
Position camera to 'head' joint's position in skeletal animation
Finished this great tutorial on skeletal animation:
https://learnopengl.com/Guest-Articles/2020/Skeletal-Animation
All works as expected, no issues!
Here is what matrixes I use to achieve skeletal ...
1
vote
0
answers
72
views
Cannot transform vectors from viewport to world
I started working on a small raytracer project, and i decided to reuse my already existing openGL renderer to do this, i'm using GLM to manage transforms/positions.
However, i stumbled upon a very ...
1
vote
0
answers
117
views
How to calculate a direction vector from a 3x3 rotation matrix?
I have a dataset containing 2D images of telco towers and metadata. Each 2D image has 3x3 rotation matrix which provides orientation info about the drone when it captured the image.
Now I have a 3D ...
0
votes
0
answers
435
views
Suspension vector direction of a raycast vehicle
I'm working on a raycast-based vehicle in a 3D world using a physics engine. It's basically a chassis object that contains a transform (translation, rotation, scale), a dynamic rigid body (with mass, ...
0
votes
1
answer
162
views
How can I calculate vertex positions for a rectangle outline using a unit square, vertex normals, model matrix and outline thickness?
I'm trying to draw a hollow rectangle (i.e. the border of a rectangle without the middle) using a unit square plus normals. The actual positions are being calculated in my vertex shader.
For example, ...
0
votes
0
answers
577
views
invert:condition "det==0" is true error with no obvious cause
For my project I am turning my CharacterBody3D 90 degrees on the x-axis towards a wall.
To achieve this I set basis.Z to the <...
0
votes
1
answer
73
views
Usage of 'World rotation quaternion'?
While debugging the code that decomposes the world matrix, I found that the decomposed world rotation value is different from the world rotation value stored in Transform.
Simply, World Rotation is ...
0
votes
1
answer
96
views
Using an InputField to enter a distance and then move an object to a location based on the input: object returns to old position
I have attached a script (1) to the InputField for ease and it displays HA changing when I alter it during run time in the ...
1
vote
0
answers
78
views
3D transform hierarchy rotation applied in wrong order
I'm following in the footsteps of this blog in implementing a transform hierarchy to my game engine scenes. I have a fairly similar implementation for a 3D transform:
...
0
votes
0
answers
131
views
How to obtain the Position on the screen (Vector2) of the Position of an object in the world (Vector3)?
I have been searching around for a solution to this but still haven't been able to use it or find it, the thing is i need the Screen Position of an object that is being seen, for this i have three ...
0
votes
1
answer
118
views
What transformations are performed under model space?
I am struggling to understand the relationship between model transformation, model space, and world space.
I understand that model transformation transforms an object from model space into world space....
1
vote
1
answer
608
views
In the Unity editor, why are the coordinates of a newly created root object not set to 0,0,0 when the object is at the origin?
My initial coordinates of a newly created object without a parent are not 0,0,0
They’re supposed to be at the origin. Instead they are some random number.
And how can I set them to zero without moving ...
0
votes
1
answer
111
views
Efficently Computing the Inverse Affine Transform
Given a single affine transformation in 3D (i.e., TRS transforms) that is
represented by a translation vector (t), quaternion (r) and scaling vector (s).
Is there some way of efficiently computing the ...
0
votes
1
answer
174
views
Efficiently Computing a Composed Affine Transform
Given two affine transformations in 3D (i.e., TRS transforms) called T0 and T1, each represented by a translation vector (t), quaternion (r) and scaling vector (s).
Now, say that I want to compute the ...
2
votes
1
answer
684
views
How do I create a localtoworldmatrix and worldtolocalmatrix in Godot?
From what I can tell Godot uses Projection for 4x4 matrixes, but I see no way to generate a localtoworldmatrix from a given transform in Godot, how do I do this?
0
votes
0
answers
52
views
How to stretch a cylinder when dragging with a Ray Interactor?
I'm making a VR game in Unity.
I want to select a cylinder with ray interactor and drag it, and as I drag, it should stretch.
This is the code I have currently for 2D:
...
1
vote
1
answer
241
views
How to set world rotation directly in Stride?
I just started looking into Stride as a replacement for Unity, and I'm trying to rewrite some scripts.
My question is: How do you set the world rotation of a transform component?
In other words, what ...
1
vote
1
answer
322
views
I want to convert world coordinates into camera coordinates
In world space, I have an axis (eg. [-1, 0, 0]) and a point (eg.[2,5,1]). I also have a 4x4 viewmatrix. Now I want to transform that axis and point in camera frame.
I am getting really confused. Does ...
0
votes
2
answers
155
views
How to keep an object that rotates around another at the same height when the radius changes?
In my game, I have one object that rotates around another using transform.RotateAround, and I need to change the radius of its orbit.
The behavior now is that the ...
0
votes
1
answer
531
views
Why doesn't RectTransform.GetWorldCorners() employ any camera?
Typically, conversion methods from world to screen coordinates and vice versa use a camera to perform these calculations, so I'm wondering how does GetWorldCorners ...
1
vote
1
answer
157
views
Move object continuously along y with optional movement along x
I am looking for a sensible way to continuously move an object downwards with constant speed while moving left or right by some amount x when the user presses the left or right arrow keys.
Basically, ...
3
votes
1
answer
4k
views
How do I keep a node centered while animating scale in Godot?
When scale is modulated, the item scales from the top-left corner. I tried changing anchors preset to "center" but it still scaled from the top-left corner. How do I make it scale from ...
1
vote
0
answers
54
views
How do I rotate OBJ submeshes relative to themselves (or arbitrary point, as opposed to relative to the whole model)?
I'm creating my own flight simulator game from scratch, using Swift and Metal, for learning purposes, and I'm wondering how I can move certain parts of my aircraft model.
My model is a free OBJ file ...
0
votes
1
answer
268
views
When to use InverseTransformDirection in Unity
I want to know when to use InverseTransformDirection.
Unity documentation says : "Transforms a direction from world space to local space". Honestly, it is not clear for me.
I came across ...
1
vote
1
answer
98
views
Clamp rotation of a follow camera when its target is falling
I'm using this camera script to follow a cube. The cube has rigid body with gravity enabled. There is a plane on which the cube moves. If it goes off the plane, the cube starts falling. However when ...
0
votes
0
answers
269
views
LocalPosition always (0, 0, 0) on UI component after assigning it in script
I have a card prefab setup to render a card like this:
I'm in the process of creating a hand prefab to contain a set of cards and manage the animation to slide in each of the cards. Each hand has 5 ...
0
votes
1
answer
83
views
Orient a player mid-air to their predicted landing orientation in Unity?
Ever played Skate 3? When dropping into a ramp, or if you're midair, your player's up direction aligns to the normal of the surface you're about to land on, while respecting the player's forward ...
0
votes
1
answer
1k
views
How to glue objects together so they move as one?
I'm making a puzzle game and can't find ANY solution on how to glue parts so I can move them together as a unit. :(
I tried to making them depend like parent and a child, but when I touch the child, ...
0
votes
1
answer
977
views
How to check if one object's local bounding box contains another
I am currently trying to check whether the first object contains a second.
I first tried to use the bounding box, but it is defined in world space, so it is not working with my rotated cubes.
Then I ...
0
votes
1
answer
1k
views
How to set up view and model matrices for 3D rendering?
For various reasons I am building a very simple graphics engine. I have a pretty good 2D thing using plain SDL2 and C that essentially boils down to a single "putpixel" function. I can ...
0
votes
1
answer
61
views
How do I spawn the tiles on the global z axis instead of local z?
I'm trying to spawn infinite tiles in a 3D runner game, but the tiles are spawning at the wrong position and on the wrong axis.
Technically, the code is working as it should, it is spawning and ...
0
votes
1
answer
209
views
How do I make an object move to a certain location when the player looks at it?
I want to have an eyeball that when the player looks at, it disappears by moving to the side. Like in a horror game. I know how to make the object move to a set location but I don't know how I would ...
1
vote
0
answers
43
views
Set hologram position to the corresponding position of an object the mouse is hovering over, but offset is doubled for some "mounts"
I am making a factory game and for it I need to set the position of a hologram of a machine so that the end of the hologram's conveyor snaps to the end of the machine next to its conveyor when ...
0
votes
0
answers
230
views
Keeping background image fixed along Y axis of cinemachine camera
I have a background that I'd like to remain in the same position relative to the camera along the y-axis, but scroll in parallax along the x-axis. The x-axis parallax part I was able to implement just ...
0
votes
3
answers
274
views
Respawn Player to Respawn point when colliding with a Hazard
I have grid movement set up for the player within a set space. The player moves one unit at a time and can move several units when holding down a direction key. I would like the player to respawn back ...
0
votes
2
answers
190
views
Find coordinates in one space from another
I'm trying to determine what coordinates are in one space when given a point in another space.
For example, I've got a Matrix4x4 that I can use to convert a point in unity's world space to a skewed ...
0
votes
1
answer
264
views
Problems with rotating Child Objects
I'm writing a Transform script for a Monogame project and I'm trying for a few days now to fix the Rotate method of this script, but without success.
Currently, the Parent transform only rotates ...
0
votes
2
answers
1k
views
I have imported a FBX model. It has predefined Transform values in Imported Object setting in the Inspector. How can I change those transform values?
what my problem is:
I imported FBX models, when I click those objects from Project tab, I see the values of Transform are different and can't be changed (The Transform values under Imported Object ...