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
2
votes
1answer
92 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 ...
1
vote
1answer
398 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
2k 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
90 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
275 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
1answer
439 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
1k 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
435 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
364 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: ...
3
votes
1answer
165 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 ...
2
votes
1answer
330 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
1k 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
1k 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
188 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
313 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
307 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
993 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: ...
-2
votes
2answers
521 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
127 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
646 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
63 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
144 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
1answer
503 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 ...
1
vote
1answer
79 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
164 views

How can I rotate childrens nodes with parent node in cocos2dx?

Consider the following code... ...
1
vote
1answer
708 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 ...
3
votes
1answer
8k 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
2k 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
800 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
1answer
65 views

Fixed distance increments between two Vector3 positions

I have two Vector3 positions: Vector3 start = new Vector3(1f, 1f, 1f); Vector3 target = new Vector3(5f, 5f, 5f); How do I transform gameobjects a fixed amount ...
3
votes
1answer
107 views

How to properly scale Image components to screen percentages?

Let's take a Sprite. I have two methods for retrieving an orthographic size of the screen: ...
0
votes
1answer
39 views

Transformation movement by using Accelerometer data

Is It possible to make transformation movement by using Accelerometer data or Accel + Gyro ? as we know, we can make rotation by using Accel or Gyro data. However, how can we make transformation ...
0
votes
1answer
259 views

How to achieve an orbit-adjustable rotation?

Here's a script: ...
0
votes
1answer
690 views

Changing a rotation and position of the camera smoothly when a button was clicked

How can I change a rotation and a position of the camera smoothly when a button is clicked in Unity? I do not want to use Update function to implement this and I do not have a GameObject or Transform ...
0
votes
1answer
62 views

Limit the grid fill

I'm doing some grid snapping and I wanted to fill out my grid on the gameObject surface. However I can't figure out the math on how to limit the grid fill. Here's the snippet: ...
2
votes
1answer
594 views

Rotate object such that a child object is facing a target (3D)

Given a parent object A and a child object B, how do I find the rotation of A such that B is pointing toward the position of a target C. This is a simplified way of solving 'what angle does the torso ...
1
vote
1answer
2k views

Scale object based on another object's position

Despite an hour or so of Googling I can't seem to figure out how to calculate the scale factor based on distance. Here's the illustration of my problem. I've tried manipulating the x values and such, ...
0
votes
1answer
601 views

Position Text Mesh above parent transform in world space

I'm making an isometric-ish 2d game in Unity. I want to display text above a sprite during certain conditions. For this, I'm using a TextMesh instantiated as a child of the sprite. In local space, ...
1
vote
0answers
308 views

Resize from one side of the object in runtime Unity

For now I managed to resize my object but it resizes always from the center. I have the same problem like this question here. I've been thinking like adjusting the position and stuff, but nothing ...
3
votes
1answer
477 views

What is the proper way to convert meters to pixels when using Box2D?

I'm working on a platformer and I've chosen to use Box2D for physics but I'm having trouble converting meters to pixels. I have a static object and a dynamic object. The dynamic object falls onto the ...
1
vote
2answers
950 views

synchronized transform is always 0,0,0 in Photon unity

I'm making a simple zombie co-op game with Unity and Photon and have problem with sync enemy transform. First, I need to explain my idea of chasing enemy AI. Enemies are using NavMeshAgent to finding ...
1
vote
1answer
81 views

Help with transform.lookat and camera? [duplicate]

Vector3 mousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition); transform.LookAt(mousePos); This will actually make the camera follow the mouse, but it ...
0
votes
1answer
505 views

Transform.position is being changed, but character is not moving back to it when told

I'm trying to make a respawn point for my car to jump back to if it presses a button. I can see, using the Print() lines, that all the variables are correct and the methods are being triggered when ...
1
vote
1answer
1k views

Why does the Debug.DrawRay return these weird lines

I am working on a small feature of a 2D mobile game where a indicator points towards a object in 2D space. I am trying to make the indicator turn towards the object, however the vector I am trying to ...
1
vote
1answer
470 views

Apply new default transform values for gameobject

I'm not sure if the title is correct. But how does one go about the following: I imported a mesh created in blender.When i import the object it is at the desired rotation and scale, however, when i ...
0
votes
1answer
22 views

Transform values stay zero while catching mouse movement

I am working on a game using GoogleVR, but I don't think that has anything to do with my problem. Basically, I am testing to see if I can move a stick by using the mouse at the moment. I am getting ...
0
votes
1answer
1k views

Convert skew to rotation + scale

I'm working on a plugin for Unity that takes data extracted from a 2D animation software and convert them to work with Unity Animator. I'm blocked with the "skew" property. Here are the data I got in ...
3
votes
2answers
848 views

How do you transform a coordinate system from Cartesian to Isometric?

Apologies if my example is a bit contrived, I've been trying to figure out how to apply matrix transformations to this coordinate problem, and I'm not getting the right output. I need to understand ...
-1
votes
1answer
2k views

Rotate Earth around sun, and moon around earth

SOLVED: I'm trying to rotate the moon around the earth. Which this part of the code only the earth is rotated around the sun, how can I make the axis to be center of earth's object? I thought about ...
4
votes
3answers
2k views

In Unity, how to get reference of descendant?

I'm trying to get descendant game object, not a child. Let's assume that I have a GameObject and it's hierachy looks like this: ...

1 2
3
4 5
9