Questions tagged [transformation]

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

89 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4 votes
0 answers
912 views

Shadow mapping - Can't get the right texture coordinates

I'm trying to implement shadow maps for Spotlight's, but alas I can't get them to work. I have verified that my fragment shader is getting the shadow map texture. I can sample from it in the ...
Yattabyte's user avatar
  • 1,013
1 vote
0 answers
32 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: ...
Boyfinn's user avatar
  • 11
1 vote
0 answers
32 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 ...
Tino's user avatar
  • 11
1 vote
0 answers
34 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 ...
Commander Of The Wind's user avatar
1 vote
0 answers
410 views

What is the correct way to combine transforms together?

I have a type called transform in my game engine: ...
Guillaume Racicot's user avatar
1 vote
0 answers
161 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 ...
JShoe's user avatar
  • 75
1 vote
0 answers
51 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 ...
チーズパン's user avatar
1 vote
0 answers
179 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 vote
0 answers
259 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
1 vote
0 answers
148 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 ...
yah_nosh's user avatar
1 vote
0 answers
89 views

How can I get my player's character to slide along a rail?

I am creating a snowboarding game and would like my player to be able to jump on a rail and move along it if it lands on it. I have no idea how to approach this. I have already tried using ray casts ...
Knuckles209cp's user avatar
1 vote
0 answers
108 views

Matrix for transforming a square to a quadrilateral

I have a square of points {<0, 0, 0>, <6, 0, 0>, <6,0, 6>, <0,0,6>} (The square is placed at the origin in the xz plane in opengl). Want to apply a transformation/s on the square and make ...
Argha Chakraborty's user avatar
1 vote
0 answers
383 views

Position an object at the center of the screen

I need to create a grid of squares such as the grid is centered on the screen. Here is a schema: I need the two green lengths to be equal, and the two red lengths to be equal. Here is the method I ...
Eldy's user avatar
  • 835
1 vote
0 answers
85 views

Unwanted continuous rotation with Quaternion

I am probably missing something simple but ... this is how I'm calculating the world matrix of my object: ...
ChaoSXDemon's user avatar
1 vote
0 answers
449 views

Resize from one side of the object in runtime Unity

For now I managed to resize my object but it resizes always from the center. I have the same problem like this question here. I've been thinking like adjusting the position and stuff, but nothing ...
Mira's user avatar
  • 139
1 vote
0 answers
3k views

How to move one object to another object's position

So I'm want to move one game object (my player) to the position of another game object, on keyDown. I'm just not sure how to reference the position of the object which is where I want my player to ...
nova nanite's user avatar
1 vote
0 answers
97 views

Cube Translation Looks All Wrong

I'm making a very simple cube in OpenTK and it seemed to be going fine until I tried to move it around. Moving it along the X Axis seems to elongate the cube, not the result I hoped for. My Vertex ...
user avatar
1 vote
0 answers
410 views

How to use 3D transformation matrices with GLM old version that has simd functions

I need matrix 3D transformation, model transformation i.e scale-rotate-translate and then that model into world space so model-projection-view matrices. I need it with GLM specified simd vectors and ...
Aiman Shaikh's user avatar
1 vote
0 answers
206 views

Understanding the ModelView Matrix

I want to analyze the each component of my 4*4 ModelView Matrix. I came to know that the starting 3*3 of ModelView Matrix ...
Marvel's user avatar
  • 131
1 vote
0 answers
157 views

Rotating an Object Around an Axis

I have a circular shape object, which I want to rotate like a fan along it's own axis. I can change the rotation in any direction i.e. dx, dy, dz using my transformation matrix. The following it's ...
Marvel's user avatar
  • 131
1 vote
0 answers
20 views

Script of trajectory without itween

I use itween for trajectories of car. I do not want to use him anymore because I find him very heavy.( more 100 cars in my scène) I found scripts but all one a variable speed to turn around points. It ...
pat's user avatar
  • 11
1 vote
0 answers
1k views

how to properly rotate in directX11

I am trying to Rotate a textured quad in directX however I think i am missing something. I am pretty sure it is because i am applying transformations to the WorldMatrix instead of the ObjectWorld, ...
naahn's user avatar
  • 11
1 vote
0 answers
411 views

SDL and smooth transition between changed movement direction

I have an object at position (x,x). Using SDL keyboard events every time the user presses one of the arrow keys the objects is to be translated (via a glTranslatef()...
rbaleksandar's user avatar
1 vote
0 answers
243 views

Transformed Vertices have wrong Z Axis

For quite some time I've been working on my open 3D game engine, to learn how this stuff works. You can see the full codebase relating to my problem here on GitHub. I'm using an OpenGL 3.3 Core ...
xythobuz's user avatar
1 vote
0 answers
288 views

parented/constrained object transform lags when moving character in unity3D

Hi I have a simple raycast-base gun that emits particles along it's path to fake bullets. Whenever I move the camera/character- the particles are misaligned, as well as anything else I try to modify ...
Tyler Beaton's user avatar
1 vote
0 answers
44 views

Connecting a model's joint to the joint of another model

I am trying to figure out the math behind orientating and translating a model so that a specified point on the model will connect with a specified point on another model. For example, given the ...
Colton's user avatar
  • 202
1 vote
0 answers
114 views

Relative Transformations for Bones

I'm using Blender to export my armatures in relative coordinates, and I'm trying to get to absolute coordinates in my engine. For the above example, the childBone's ...
371273's user avatar
  • 131
1 vote
0 answers
331 views

World to Pixel Transformation

My objects have a location in world coordinates (basically 1.0f is a meter). If I simply draw my objects using their world coordinates, each meter will correspond to a pixel. Obviously that's not what ...
D00d's user avatar
  • 11
1 vote
0 answers
1k views

Move parent according to child axis in Unity?

Can I ask my parent to move according to the child axis? This means if I turn right, then right again, the parent has to be at 180° from its original position, and not only at 90° (because "Right" ...
Paul's user avatar
  • 679
0 votes
0 answers
23 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, ...
Splo's user avatar
  • 736
0 votes
0 answers
77 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 <...
NEWBIE's user avatar
  • 23
0 votes
0 answers
19 views

while rotating around Y in Transform, it rotates around Z in Viewport Is it a bug in Unreal Engine 5.3?

I struggle to understand how the transfomartion is working in Unreal. I've faced one interesting situation and cannot realize what happed. Could somebody explain please why my rig is rotating around Z ...
Dron4K's user avatar
  • 131
0 votes
0 answers
41 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 ...
user57129's user avatar
  • 121
0 votes
0 answers
25 views

TBN matrix multiplication by normal map texture sample gives incorrect results

Vertex shader: ...
Nickname WENGREEN's user avatar
0 votes
0 answers
18 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: ...
SPP's user avatar
  • 1
0 votes
0 answers
289 views

3D Ragdoll, skinned mesh + three.js + cannon.js

I'm trying to develop a ragdoll from a skinned mesh, in three.js using cannon.js as physics engine. I'm struggling with a lookAt problem for bones. Let me explain the method I used. I made a skinned ...
stmaccarelli's user avatar
0 votes
0 answers
24 views

Bullet spawning at world origin instead of muzzle socket on static mesh

I placed a socket called "Muzzle" on the end of my static mesh as shown here I have it so when I left click, my bullet should spawn on the muzzle socket, but for whatever reason, it spawns ...
desperrrr's user avatar
0 votes
0 answers
132 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 ...
Samuel Slade's user avatar
0 votes
1 answer
43 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 ...
LeytonMate's user avatar
0 votes
1 answer
551 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 ...
Muhammad Faizan Khan's user avatar
0 votes
1 answer
35 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 ...
Aj_Xocan's user avatar
0 votes
0 answers
157 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 ...
Mav's user avatar
  • 99
0 votes
1 answer
194 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 ...
NOrlYNcE's user avatar
0 votes
1 answer
220 views

Finding the center of rotation in 3d knowing the start/end transformations

I need your help to solve a trigonometry problem, I'm unable to find any documentation about on the web... For convenience, I will use "transform" to indicate a position+orientation. Let's ...
lightimpact90's user avatar
0 votes
1 answer
740 views

Stop an object from rotating past a certain rotation value in Unity

Learning how to program in Unity, so bare with me. I'm making a game called Flappy Bird and I'm having issues with my z-rotation boundaries. Let's say I have some gameObject (call it Bird) that goes ...
Zeid Tisnes's user avatar
0 votes
1 answer
33 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 ...
philB's user avatar
  • 129
0 votes
0 answers
208 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). ...
Zong's user avatar
  • 1
0 votes
0 answers
225 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 ...
Silz's user avatar
  • 37
0 votes
0 answers
58 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 ...
Newline's user avatar
  • 173
0 votes
1 answer
342 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: ...
Daniel Marques's user avatar