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
1 answer
29 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 ...
Tee Mo's user avatar
  • 3
0 votes
1 answer
43 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 ...
Stan's user avatar
  • 3
1 vote
0 answers
31 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
0 votes
0 answers
38 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
24 views

TBN matrix multiplication by normal map texture sample gives incorrect results

Vertex shader: ...
Nickname WENGREEN's user avatar
0 votes
1 answer
38 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....
CheeseS's user avatar
1 vote
1 answer
486 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 ...
Mich's user avatar
  • 131
0 votes
1 answer
54 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 ...
Xaldew's user avatar
  • 105
0 votes
1 answer
52 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 ...
Xaldew's user avatar
  • 105
2 votes
1 answer
165 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?
Ethan's user avatar
  • 145
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
1 vote
1 answer
100 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 ...
ZReeder's user avatar
  • 13
1 vote
1 answer
202 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 ...
Anmol Gupta's user avatar
0 votes
2 answers
64 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 ...
Daniel Lip's user avatar
  • 1,737
0 votes
1 answer
172 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 ...
Serg's user avatar
  • 373
1 vote
1 answer
61 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, ...
ChrisC's user avatar
  • 116
1 vote
1 answer
1k 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 ...
Seph Reed's user avatar
  • 225
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
0 votes
1 answer
105 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 ...
Achie1's user avatar
  • 169
0 votes
0 answers
261 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
1 vote
1 answer
45 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 ...
single arrow games's user avatar
0 votes
0 answers
126 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
42 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
352 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, ...
Dead Lord's user avatar
0 votes
1 answer
473 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
237 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 ...
MalphasWats'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
1 answer
124 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 ...
Dawid's user avatar
  • 3
1 vote
0 answers
33 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
0 votes
0 answers
152 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
3 answers
175 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 ...
nataliadalomba's user avatar
0 votes
2 answers
112 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 ...
Hex Crown's user avatar
0 votes
1 answer
191 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
2 answers
548 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 ...
sdo's user avatar
  • 21
1 vote
1 answer
676 views

Y in transform.position has different value in inspector than in code

I've got very simple code: ...
Shagohad's user avatar
  • 111
0 votes
1 answer
694 views

Detecting whether sprite is outside the camera's view

I want to detect when the game object is not visible anymore. I search for the size of the SpriteRenderer, and convert it to screen space. Then, I check if the ...
Mwoon's user avatar
  • 3
0 votes
0 answers
32 views

Need help replicating this unity transformation in raylib [duplicate]

i was hoping i could get some advice on a transformation im trying to perform on some billboards. i have a billboard in 3d space thats being rotated a long the view matrix's up + right axis, against a ...
hexley's user avatar
  • 5
1 vote
1 answer
156 views

Shaking UI World Space element when keeping it centered between 2 objects

So I have a ship in the game, and I can click on a Sail to make a World Space UI panel appear. The panel will follow the selected sail and also always Billboard towards the camera. The problem I have ...
questioneeeeer's user avatar
0 votes
1 answer
215 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
1 vote
1 answer
496 views

GridMap centers meshes of different heights in cell

I am trying to use the superb GridMap in Godot 4 beta 5. I have, so far, only 2 different types of meshes in my MeshLibrary. 1x1x1 cube 1x1 plane My intention is ...
Matthew Goulart's user avatar
1 vote
3 answers
469 views

How do I move an object along its local axis?

I am new to computer graphics and am trying to make a simple little game where I can move a cube around with the keyboard. I have it so you can rotate the cube with the arrow keys, and I wanted to ...
Joe's user avatar
  • 13
0 votes
1 answer
38 views

Little problem with offsetting transformed vertex in a vertex shader

I’m working on some home-made menu stuff under DX11. I’m creating the rect menus at start all located at position 0,0. Each menu contains some lines of options. Everything is created as transformed ...
philB's user avatar
  • 129
0 votes
1 answer
237 views

What is the equivalent of Unity's Transform.Forward in Stride

To get the forward direction in Unity, I use Transform.Forward. How do I do this in Stride?
Ravenscroft's user avatar
2 votes
2 answers
1k views

How to convert a 4x4 matrix transformation to another coordinate system?

Is there a general method to convert a matrix transformation from one coordinate system to another, so that the resulting transformation looks the same on screen? For example: There are some ...
thalm's user avatar
  • 227
0 votes
1 answer
664 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
113 views

Gap between two 3D objects in Unity

Quick question related to Unity: if I have two objects (A and B) to create some tunnel, how can I make a constant gap? I thought of having A and B instantiated with a random value to start with; ...
Zeid Tisnes's user avatar
0 votes
1 answer
61 views

How to rotate two transforms to touch at a point, while preserving forward direction?

I have a transform which I need to point one of its axes in the direction of another game object, without disturbing or rotating the other axes in any way. Consider the way your hips move around on a ...
DIGITII's user avatar
  • 58
0 votes
1 answer
114 views

Get component of velocity parallel to a normal

I would like to transform a rigidbody's world velocity into a local velocity based on a normal direction. When the rigidbody is moving towards and within a range of a object, I use a raycast to ...
Charl Cillie's user avatar
0 votes
1 answer
77 views

2D Vector local to global space without trig/sqrt

Per this answer to this question, a cheap way (i.e., without trig/sqrt) to convert from global to local space, given LocalOrigin, LocalI, LocalJ, and GloablPoint is (in rough pseudo code) ...
Moose Morals's user avatar

1
2 3 4 5
11