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

World bending (inception like) implementation from scratch

I'm doing my very first engine in c from scratch as an exercise and I wanted to implement this as an added bonus. However I know 0 about three.js or GLSL and I'm having a really hard time ...
user avatar
  • 101
0 votes
1 answer
50 views

Transforming world to canvas goes wrong when camera is moving

I am attempting to draw a box around a selected target in my space game. I had this working fine using normal techniques when my canvas was set to Screen Space - Overlay. However my setup is that ship ...
user avatar
0 votes
1 answer
30 views

How to do local mirroing of object from the camera point of view?

I would like to render an object as if mirrored but on its own world position and with a mirrored orientation being camera view dependant. Something like the billboarding but keeping the 3D shape and ...
user avatar
  • 47
0 votes
1 answer
22 views

Converting local rotation data from one rig onto another of a different orientation

I have an animated object which consists of a set of linked transforms. Think of them as bones. This object is animated - external to my software - and an API streams the local rotations - as ...
user avatar
  • 161
1 vote
1 answer
59 views

How to make an object move and rotate the same amount as another obejct

INTRO: I am trying to make a camera move around in a fast moving, rotating in all axis, spaceship.... This person has achieved exactly what I need to achieve if that is a good reference for you (go to ...
user avatar
  • 169
0 votes
1 answer
107 views

How to calculate camera view matrix from world transform, specifically the orientation?

In my engine, camera is just any other object in the scene. It has a transform -- position, rotation (quaternion), and scale (ignored for camera view matrix). I want to convert this to the camera's ...
user avatar
  • 189
0 votes
1 answer
54 views

Correct camera transformation for first person camera

I am making a camera in openGl and I am having troubles with first person camera. So I had a few versions of camera transformation and all of them had their own problems. So at first, I was doing ...
user avatar
0 votes
1 answer
28 views

Find out (general) orientation of cube faces with rotated and translated camera

I have the following problem. I have a camera that is initially looking at a cube. The cube is with center at (0, 0, 0). The camera that is initially on (0, 0, 60). The camera can rotate and translate ...
user avatar
0 votes
2 answers
27 views

Changing Model's rotation to keep its left side toward the pivot as it goes in a circle

I wrote a little script for my scene that allows my ship to circle an island, and it seems to work alright. Now I am trying to get the ship model to stay broadside to a pivot point in the center of ...
user avatar
  • 137
1 vote
0 answers
79 views

What is the correct way to combine transforms together?

I have a type called transform in my game engine: ...
user avatar
0 votes
0 answers
64 views

Moving Object "in or out" along the z axis using Sin(time) or Cos(time)

I am new to game development, and I have successfully moved an object in the x and y directions using Mathf.Sin(x) and Mathf.Cos(x). But I'm unable to move same object in the z-direction (in or out). ...
user avatar
  • 1
0 votes
2 answers
43 views

Unity Follow Object Movement in Local Space?

I have two objects in my scene each at different positions and rotations in the scene. In this example, object A (the leader) moves according to controls. I need object B (follower) to follow the ...
user avatar
1 vote
0 answers
53 views

How do I make a mask that dictates which layers are visible in Unity?

I'm trying to create an effect where the player progresses from one level to the next by a portal appearing as a rip in the fabric of time, and the portal grows until it'd half the screen, then ...
user avatar
  • 75
0 votes
2 answers
46 views

Convert a dot product scalar for a triangle's slope, into a translation ratio?

Struggling with accurate terminology; I've got a 3D app with triangulated terrain, where it looks like a checkerboard from the top view, where every cell is two tris, and every cell is equal size (1 ...
user avatar
  • 49
0 votes
0 answers
46 views

transform.localPosition does not wok in Unity

When im breaking fence GameObject there should pop up scores, so it works fine. But position of pop up scores is too low, im trying to raise it by ...
user avatar
  • 1
0 votes
0 answers
37 views

Trying to understand proper naming of transformations and coordinate systems

So far in my code I only dealt with transform matrices that I fed to OpenGL (the 4x4 float matrices), and had a class that was used to do transformations on the CPU side and generate the OpenGL ...
user avatar
  • 163
0 votes
0 answers
27 views

Easy code to make object raise when collecting item? (new coder)

Trying to make the statue (queen) in the background raise from the ground when an item is collected (which currently just gets destroyed to show that) and having issues with timelines and assigning ...
user avatar
1 vote
2 answers
86 views

Placing player hand on wall, only works with right-angled walls

...
user avatar
0 votes
0 answers
14 views

How to convert local location to global location given orientation?

I'm working with Unreal Engine and I've come across a scenario where I have a location vector point in local coordinates and I need to transform it to global ...
user avatar
-1 votes
1 answer
42 views

Each time a new platform spawns, rotate it 90 degrees from the previous

All I want is when the platform changes its position on the x or the z axis, then rotate the whole platform by 90 degrees. When I try to do this with the following code, I don't see any change - the ...
user avatar
0 votes
1 answer
102 views

confusion on desired velocity

In one of the videos of the dead earth game dev series , the author mentions of calculating a local desired velocity of a NavMeshAgent. My point of confusion was, ...
user avatar
0 votes
1 answer
37 views

How to make a sprite face the mouse while remaining upright, without negative scale?

In the game I'm creating I have a sprite that needs to constantly be facing the mouse, but the sprite also always needs to be facing "up". Because of the Polygon Collider 2D and Shadow ...
user avatar
0 votes
1 answer
104 views

Calculating child world translation, rotation and scale

I'd like to know if it's possible to calculate a child's world translation, rotation and scale individually. I'm used to seeing devs resorting to matrix multiplication and then decomposition, like so: ...
user avatar
0 votes
0 answers
23 views

Adjusting custom 2D transform gizmos to work with rotated shapes

I am trying to coding 2D transform gizmos with Rotate and Scale options. There are only two button. One is for rotate the object and another one is for scale the object in local space: GIF If rotation ...
user avatar
0 votes
0 answers
75 views

camera snapping weirdly when aligning to view

The apply word above comes from 'blender 3D'. Basically, once you rotate an object , it's x, y, z value changes. What apply does is keep the transformation, but, change the x, y, z value back to 0. Is ...
user avatar
2 votes
1 answer
169 views

Why do my bullets always go the wrong way when my player turns around?

So I tried to make a shooting mechanism for my game. My player can shoot in the direction pointed by the mouse. My player can also turn around, facing the other way as he walks. The firing mechanism ...
user avatar
  • 88
0 votes
0 answers
49 views

Obj file vertex coordinates to new coordinate space

I am trying to convert the vertex positions in my obj file to a new coordinate system. I understand I need to multiply each vertex with the transformation matrix, however I am trying to figure out the ...
user avatar
  • 101
0 votes
1 answer
109 views

Calculating view matrix from rotation, elevation and location

I have the rotation(A), elevation(B) and location(C) of a camera in a left handed 3d space. +...
user avatar
  • 101
1 vote
1 answer
376 views

Difference between World matrix and Model matrix?

My current understanding of the Model matrix is that it is per object and stores the transformation, rotation, and scale of the object in local object space. What I'm not sure about, is that whether ...
user avatar
1 vote
1 answer
170 views

Pygame 2D : rotation around center not working properly

here is the code I use to rotate an image around its center: ...
user avatar
  • 216
1 vote
1 answer
141 views

What are the pros and cons to using Transform{position, scale, rotation} over Matrix (3x4)?

I'm using Transform in a certain case where I want extracting/changing/preserving the components {position, scale, rotation} to be straightforward - I guess that is a benefit. But when it comes to ...
user avatar
  • 111
0 votes
1 answer
245 views

How to use Transform.lossyScale in a local reference frame?

According to the Unity docs for Transform.lossyScale, this attribute is "The global scale of the object". From what I can tell, this isn't actually an estimate of the scaling aligned with ...
user avatar
  • 131
1 vote
0 answers
37 views

Visualizing collision rectangles in world space

I am calculating collision for my fps-camera by checking if the x/z-position of the camera is inside a plane. And the detection works fine. The plane is represented as two-component vectors min and ...
user avatar
-1 votes
1 answer
329 views

What happens if first we scale a rotation matrix and then multiply it with an object?

This question has been bothering me lately. I know the correct order to scale, rotate and transform a matrix but the question I have is very different. What if we first scale our rotation matrix by ...
user avatar
0 votes
1 answer
186 views

Why is transform matrix order is reversed in my Scene graph implementation?

I have researched this a lot and so far all the examples, tutorials etc always use the following order: Scale * Rotate * Translate but for some reason this order must always be backwards in my Scene ...
user avatar
  • 189
0 votes
1 answer
54 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 ...
user avatar
0 votes
1 answer
59 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 ...
user avatar
0 votes
1 answer
216 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 ...
user avatar
0 votes
1 answer
254 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 ...
user avatar
  • 171
0 votes
0 answers
65 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 ...
user avatar
  • 1
0 votes
2 answers
184 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 (...
user avatar
0 votes
1 answer
116 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-...
user avatar
0 votes
0 answers
23 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 ...
user avatar
0 votes
1 answer
52 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) ...
user avatar
0 votes
1 answer
67 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 ...
user avatar
3 votes
1 answer
165 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 ...
user avatar
0 votes
1 answer
252 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/...
user avatar
-2 votes
1 answer
223 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 ...
user avatar
0 votes
1 answer
82 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, ...
user avatar
  • 13
29 votes
1 answer
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 ...
user avatar

1
2 3 4 5
10