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

creating rotation matrix in a left handed coordinate system from a direction vector

I have been looking at creating rotation matrices from a direction vector in the OpenCV coordinate space and there is one thing that has me slightly confused. Here is an OpenCV rotation matrix, that I ...
0
votes
0answers
15 views

Issues Rotating 3rd Person Camera Following an Object's Orientation

I've developing a flight simulation in openGL with GLM in C++ and I am having issues rotating the camera around as the plane pitch, yaws, and rolls. It's also my first time using quaternions, ...
2
votes
1answer
85 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
52 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
56 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
154 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
24 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
21 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
107 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
28 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
25 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
59 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
25 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
57 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
60 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
90 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
105 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
124 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
221 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
40 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
39 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
40 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
78 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
339 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
51 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
85 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
33 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
202 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
363 views

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

In the Unity Editor, this code helps me to get the Fog GameObject: ...
2
votes
2answers
394 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
130 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
68 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
285 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
283 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
342 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
77 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
82 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. ...
1
vote
1answer
126 views

Add Lerp on only the Y axis

I want my camera to be smooth on only the Y axis.How do I do that it? Current code: ...
-3
votes
2answers
208 views

Cannot modify a value type return value of `UnityEngine.Transform.position'. Consider storing the value in a temporary variable

I'm getting the following error Cannot modify a value type return value of `UnityEngine.Transform.position'. Consider storing the value in a temporary variable with this code: ...
0
votes
2answers
104 views

Issue giving object player's hand position

I'm trying to put an object (for example a sword) in my player's hand. To do so i set the player's hand transform as the object's parent, in order to have the same movement for the object and the hand....
-6
votes
2answers
206 views

Instantiating Unity prefabs in a for loop - please help me understand how this works [closed]

What this for loop means in context of unity 3d ...
1
vote
0answers
45 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: ...
1
vote
1answer
111 views

Why is there a discrepancy between these two transform.up vectors?

I was trying to implement a feature which required transform.up, the result didn't match the green axis gizmo displayed in the editor so I assumed it was being put ...
0
votes
0answers
54 views

3D Player x positon problem

I`am make Runnig 3D game and i made to move left and right and when i move left or right i have problem with position X and rotation Y its change every frame, can someone help me to this direction. ...
0
votes
1answer
238 views

SlimDX Direct3D10 Sprite stretches with window size

I'd like to draw a sprite bitmap with SlimDX Direct3D10, but I'm stuck at this problem, where I can see my image on screen, but it gets stretched depending on the window size. The issue looks like ...
0
votes
1answer
61 views

Evenly distribution of 2 or more shapes given their x and y points inside a bounding box

I have a set of dynamically shaped objects, How do I distribute them evenly either Horizontally or Vertically.The objects are surrounded by a bounding box and the objects are placed at x,y as shown. ...