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
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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

0
votes
0answers
25 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
53 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
10 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
17 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
73 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
16 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
19 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
47 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

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
45 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
73 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
25 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
57 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
35 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
47 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
30 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
27 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
29 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
61 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
154 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
39 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
59 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
30 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
128 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
216 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
334 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
64 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
42 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
270 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
135 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
179 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
114 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
63 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
51 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
49 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
133 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
100 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....
0
votes
0answers
23 views

How to set/clear parent and maintain world position/scale/rotation in a transform hierarchy

I am attempting to code a Transform hierarchy similar to Unity's. I am able to successfully combine local position, rotation and scale, as well as to multiply child transforms by their parent ...
-6
votes
2answers
146 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
36 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
96 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
40 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
164 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
60 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. ...
0
votes
1answer
58 views
1
vote
1answer
248 views

Examples of transforming camera in its local coordinates vs world coordinates OpenGL

I am trying to learn OpenGL and am doing some beginners learning exercises. One of the exercises is to translate and then to rotate the camera along its own local coordinates and not the world ...
1
vote
1answer
689 views

How to mirror/reflect/flip a 4D transformation matrix

I am importing my animation keyframe joint data from Blender to my game engine. The joint data is a set of 4D matrices. Things are looking good except a remaining issue where the animation is facing ...
0
votes
1answer
159 views

Change localScale.x in Unity without creating a new Vector3

Is it possible to change localScale.x in Unity without creating a new Vector3?
0
votes
1answer
147 views

Matrix multiplication order for multiple model transformations

I have a problem in terms of what frame of reference, I should construct, scaling (S), rotation (R) and translation (T) for a model matrix (in that order). Let us assume the use of glm (or glsl), i.e. ...
0
votes
0answers
20 views

PrefabUtility.InstantiatePrefab disables gameObjects recursively

I'm developing an editor script and I have to use PrefabUtility.InstantiatePrefab method because I don't want to lose prefabs connection with the instantiated object. But if I set the parent of newly ...