Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [transformation]

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

0
votes
1answer
21 views

Unity, Object's vectors are not rotating with the object. what did i do wrong?

i found a youtube video (Sebastian Lague) that has a really good movement script, i understood it and used it for my character, when i started moving it, i noticed that the character rotates but his ...
0
votes
1answer
37 views

Stop movement if transform.position.y == 0

Why does the following code not step the object's movement when its y coordinate reaches zero? ...
0
votes
0answers
14 views

GameObject transform localPosition not setting when you use a function to set somewhere else in the code

So z position on some gameObject being generated from a prefab was being set wrong. I create to function to do like a reset transform thing, but when I set the localPosition in the function it does ...
1
vote
0answers
94 views

Find transformation to align two polygons at fixed points?

Problem I have a source image (arbitrary width and height c) shown here as a rectangle [X1,X2,X3,X4]. It contains two points C and D (both known coordinates within ...
0
votes
0answers
25 views

Dual Quaternion - How to apply the dual quaternion as a transform (Without converting to a matrix)

I've been trying to implement dual quaternions for a bone system and I have a few questions about them. I started by reading the beginners guide to dual quaternions (link: http://wscg.zcu.cz/wscg2012/...
0
votes
0answers
13 views

combine two translation/rotation/scale triplets without matrices

Let t1/2, r1/2 and s1/2 be two sets of transformations. Translations are vec3, rotations are quaternions and scales are vec3. Lets assume that all common operations are defined (overloaded operators ...
0
votes
1answer
23 views

Resetting The object scale to it's original size!

I have this sprite renderer in unity. I have made so that it increases it's scale. The Object is: This object is a child of empty gameObject and I have resized the parent gameObject rather than this ...
0
votes
0answers
21 views

Fingers don't move when changing Animation Timeline

I am making a custom animation for some finger bones on a humanoid model, but changing the values inside the timeline window does not visually move the fingers in the scene view. How can I preview ...
0
votes
1answer
34 views

Unity - Transform.RotateAround() + Transform.Translate() - Why is rotation offset created and how can it be fixed?

I have one object orbit another with RotateAround(), then I use Translate() to move the orbiting object in the same frame in an effort to change the distance at which the object is orbiting. This ...
0
votes
1answer
22 views

Can't rotate object after using transform.forward

I'm using above code to rotate object pointing where it moves: transform.forward = m_Rigidbody.velocity; It works fine, however the problem is that I can't ...
0
votes
1answer
56 views

How to scale an object in one direction without moving the opposite edge?

I am using Unity. In my game, I have an SpriteRenderer and I'd like it to increase its size I'd like it to lengthen to the right, without moving the left edge. I tried changing its scale to ...
2
votes
1answer
89 views

Determining Player “Forward” in VR

EDIT: I've removed some vagueness and replaced it with more of a description of the intended use case. I'm looking for some suggestions for ways to infer what the player's "forward" vector is in a ...
1
vote
1answer
25 views

Unity transform.position question

Looking at example code for mesh deformation in unity https://answers.unity.com/questions/746673/sine-wave-mesh-deform-with-different-directions.html And i see theyve used ...
1
vote
1answer
54 views

Efficiently calculate 2d world position based on parent(s) recursively

I am writing a small 2d html5 game engine in javascript that relies on the concept of a hierarchy. The scene is the root node or entity, and its children make up the game objects. These children can ...
0
votes
1answer
105 views

How do I allocate to a C# dictionary having a string key and an integer 2D array or transform for value?

I'm working in C# on a Unity 2D game that spawns a shape that has only one correct landing place. There are 7 basic shapes but the component 4 squares of each shape are unique, with each bearing, say, ...
0
votes
1answer
64 views

Can I position a player avatar behind the camera based on rotation?

I'm currently reverse engineering a video game where what's rendered on the screen depends on the proximity of the player avatar to the camera. As such, for my freecam to work properly, I need to ...
0
votes
1answer
297 views

From screen space to world space for a 2D game

I'm making a 2D game and I want the user to be able to position an object in the world using mouse input. After a while I found an answer to 'OpenGL Math - Projecting Screen space to World space ...
0
votes
0answers
29 views

How can I use NetworkTransformChild when the target only has RectTransform?

I used the normal way to add them by code like below: gameObject.SetActive(false); addNetworkTransformChild(newItem.transform); gameObject.SetActive(true); ...
1
vote
0answers
26 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 ...
2
votes
1answer
135 views

Unity move Vector3 position with transform

How can I move a new Vector3 position with a Transform? Like the transform is the parent the vector. Example if I want to push the x position for example by 10 value and I rotate the transform its ...
0
votes
1answer
31 views

Scale screen space quads (used in font rendering)

I have quads positioned in <0, 1> x <0, 1> coordinates. I use this system for font rendering. In vertex shader I have: ...
0
votes
0answers
29 views

Relative camera movement with character in center

I'm trying to translate and scale a 2D space from world space to camera space with my character in the center. Adding in the scaling is tripping me up. Here's what I've got so far, without the ...
0
votes
1answer
66 views

How to store 3d transformation in a game?

I am curious what is the best strategy to save 3d transformation of a model. Here are the few choices I think about: 4x4 matrix 4x3 matrix(skip the bottom row of a 4*4 matrix) Dual quaternions with ...
0
votes
1answer
36 views

Detect when an Oculus headset is stationary/idle using transform.hasChanged

I want to know how can I change in unity the thershold of the method below: transform.haschanged At the moment it is so sensitive and it triggers with 0.00001 change in the camera. We have ...
0
votes
1answer
68 views

Inspector does not appear to match actual value

A text object is where the inspector says, but not where I expected it, and not where Debug.Logerror says it is. What I read as my "strengthTextObj.transform.position.x" is -213 in the inspector but ...
1
vote
2answers
76 views

Why does my gameobject fly of into the air when the screen is touched?

I am encountering a peculiar problem when updating a piece of code that translates my gameobject left and right based on mobile touch input. To provide context, the platform upon which the gameobject,...
1
vote
1answer
109 views

Why does a translation matrix need extra row?

Following recommendation of this answer I've recently read the series of articles of Wolfire about linear algebra. I'm somewhat familiar with matrices and I came to a conclusion that vector and a ...
0
votes
0answers
27 views

anything wrong with a spherical camera view matrix?

Is there anything inherently wrong, if you derive your view matrix from 2 spherical coordinates (say, phi and theta) on the unit sphere? The z-axis vector would be at, say (phi, theta), the y-axis at (...
0
votes
1answer
133 views

How can you allow a sphere to rotate 360 degrees inside a hollow cylinder in Unity?

I have a hollow cylinder, within which is a sphere. The forward vector is predefined, so the user can not change their forward speed. What they do have control of, however, is the rotation of the ...
0
votes
0answers
166 views

Get bounding box of GameObject in camera image

I'm trying to get the bounding box of a single GameObject in pixel coordinates but the calculated coordinates are at the wrong position. What am I doing wrong? Here is my code: ...
0
votes
1answer
373 views

Can't set object's local rotation like rotating from gizmo in the scene

Here, I have a plane model with some sub parts(like aileron) can rotate: That red section is weight painted(rigged) vertices, and I need to control the rotation of this in Unity by script. So this ...
0
votes
1answer
45 views

How do I get a delay in motion to happen? (Unity)

I want the cockpits rotation to lag behind that of the cameras, so I wrote this code: ...
2
votes
1answer
48 views

Transfering an inertia tensor from local coordinates to another one

If we have an inertia tensor in local coordinates with a basis matrix B and we want to transform it to other local coordinates with basis matrix A, is it right to do the following: A* inv(B) *Inertia ...
0
votes
0answers
45 views

FreeGLUT - Making Planets Orbit at their own Speed

I'm currently working on a project for Uni using FreeGLUT to make a simple solar system simulation. I've got to the point where I've implemented all the planets and have used a Scene Graph to link ...
1
vote
1answer
100 views

Camera movement issue with pitch and yaw angles

I'm trying to implement a simple first person camera using pitch and yaw angles (no quaternions, I want a simple camera for debugging purposes). An Input class processes mouse input and translate the ...
0
votes
1answer
451 views

Unity RectTransformUtility.ScreenPointToLocalPointInRectangle

What does the unity's RectTransformUtility.ScreenPointToLocalPointInRectangle do I've read unity documentation but I didn't get the clear meaning.
0
votes
1answer
56 views

Camera rotation is weird when it's a child of another object

I implemented scene graph hierarchy into my 3D game engine, and there seems to be a problem with the camera's rotation when it is a child of another object. It only happens with the camera, not any ...
0
votes
1answer
105 views

Rotation along normal vector

I have a triangle in the 3D world. I have the: positions for the three points the normal vectors for the three points (all the same, because vertices are not shared) This triangle faces to a ...
0
votes
0answers
37 views

Is there a way to make a movement pattern using AnimationCurves?

I'm making a 2D space-shooter game, and I want the enemies to have specific movement patterns, ranging from simplistic like a linear left-right loop, to more complex like a parabola left-right motion (...
0
votes
1answer
235 views

Directly pass from transform feedback buffer to fragment shader

I am building terrain using a lod algorithm and deferred cascaded shadowmaps. The tessellated terrain is about 6,000,000 triangles. I tried this using 2 methods. 1st method: Both the deferred shadow ...
0
votes
1answer
442 views

UnityException: Transform child out of bounds (only in built APK)

In the Unity Editor, this code helps me to get the Fog GameObject: ...
3
votes
2answers
404 views

Transform.LookingAt() does nothing

To get used to how Godot transforms work, I am attempting to write an orbit control. The goal is for it to behave similarly to the Godot viewport. So far I have the positioning of my camera working. ...
0
votes
1answer
169 views

Too fast swipe in Unity game

I am letting the user to swipe around in some movement and to see the scene on mobile device. Facing too fast swipe. Need to make swipe slower, smother.Using the code: ...
1
vote
1answer
80 views

What is the near plane equation in NDC?

I'm trying to compute the line intersecting my plane (transformed to NDC) and the near plane. I have troubles to get a correct result and I think it is coming from the near plane equation. I ...
3
votes
1answer
290 views

representing transforms without a world/global reference frame

Background: I'm trying to make a segmented/portal-based game engine that supports impossible (non-euclidean?) geometry. By segmented/portal-based I mean the world is divided into segments which are ...
0
votes
1answer
374 views

What is FRotationMatrix in Unreal engine 4?

I am working on FPS shooter example in Unreal engine 4 documentation. One of the lines for forward movement of pawn is ...
0
votes
1answer
433 views

Moving camera in 3D - directX12

I begin to learn graphic programming on directx12. I try to make a camera wich can move dans rotate around the world. I take this code as a basis: https://www.braynzarsoft.net/viewtutorial/q16390-...
5
votes
1answer
119 views

What methods can be used to rotate a tiled structure?

I'm trying to rotate some structures that are locked on a grid-like structure. This means I'm looking for lossless ways to rotate the tiles. Maintaining proper distances are not important, I'm aware ...
1
vote
1answer
87 views

How do you develop the model matrix for an object?

This might be a misunderstanding on my part but let me give you my superficial understanding of Model-View-Projection pipeline and different coordinate systems. Then I will ask a question. As we know,...
0
votes
1answer
96 views

AddForce doesn't work anymore when Acceleration is added

Everything worked fine until I added acceleration on the x axis..now when I try to jump it just lifts up very little from the ground in a weird way and then it slowly sinks down like having 0 gravity. ...