Questions tagged [transformation]
Transformation in game development is usually refers to linear algebra operations on points, vectors and matrices.
515
questions
0
votes
0
answers
11
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
47
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
51
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
48
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
42
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
36
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, ...
1
vote
1
answer
151
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
23
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
59
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 ...
0
votes
0
answers
91
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 ...
0
votes
0
answers
18
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 ...
1
vote
1
answer
34
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
91
views
Scaling parent without affecting children scale in a Prefab
My problem:
I'm building maps for my 2D game as prefabs, these then get instantiated into the scene. The problem is that changing the scale of the prefab parent affects all children. Any solutions ...
0
votes
0
answers
77
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
36
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
133
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
222
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
78
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
27
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
74
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
30
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
89
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
0
answers
26
views
Transforming a rectangle to make sure it stays fully inside another
I am building a 2D top-down game in a custom engine. I am trying to build the camera system which allows the user to zoom and pan around the world. However, I am stuck at the point of preventing the ...
0
votes
0
answers
173
views
How to set a position relative to my player's direction?
Currently I am setting my Player's position with:
transform.position = new Vector3(target.x, target.y, target.z);
However, the X and Z of this do not work the same ...
0
votes
3
answers
83
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
84
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
178
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
261
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 ...
0
votes
1
answer
495
views
Y in transform.position has different value in inspector than in code
I've got very simple code:
...
0
votes
1
answer
439
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 ...
0
votes
0
answers
31
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 ...
1
vote
1
answer
125
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 ...
0
votes
1
answer
182
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 ...
1
vote
1
answer
229
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 ...
1
vote
3
answers
229
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 ...
0
votes
1
answer
28
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 ...
0
votes
1
answer
171
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?
1
vote
2
answers
742
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 ...
0
votes
1
answer
440
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 ...
0
votes
1
answer
85
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; ...
0
votes
1
answer
51
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 ...
0
votes
1
answer
68
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 ...
0
votes
1
answer
54
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)
...
0
votes
2
answers
91
views
Transforming 3d point for depth testing
I have a ray and its direction is (o,d). Multiply it by the model matrix to rotate the model.
...
0
votes
1
answer
607
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 ...
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 ...
0
votes
1
answer
147
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 ...
1
vote
1
answer
107
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 ...
0
votes
1
answer
1k
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 ...
1
vote
1
answer
407
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 ...