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
0
votes
0answers
6 views

getting data from an array stored in a different script Unity [duplicate]

LandingScript w = GetComponent<LandingScript>(); foreach (Transform x in w.Waypoints) { allWaypoints[i] = x; i += 1; } i want ...
0
votes
0answers
23 views

2D engine design/architecture: transformations

Hello! I'm working on this hobby little 2D engine in JavaScript because I want to learn how all this things are implemented and architectured in general. Internet is full of resources but most things ...
1
vote
1answer
56 views

Raycast wrong direction

I use Physics.Raycast and transform.forward to shoot a ray in front of my gameobject, but the ray gets cast downwards instead. <...
2
votes
1answer
64 views

How to align a 3D object with four points?

I'm sure there's a better way to articulate this question, but I lack the vocabulary. Imagine a skateboard. As it rolls straight down a road, the "deck" is aligned with the road, just offset a few ...
0
votes
1answer
45 views

How to calculate the transformation such that two points with different position, orientation and origins line up?

Let's say you have two different 3D Objects which both contain a node that is off center (not at the origin) and have an orientation. How do you calculate the transform for one of the object so that ...
0
votes
1answer
57 views

Calculate Discrete Fourier Transform by using c#

There is a definition of Discrete Fourier Transform: I want to calculate amplitude and phase of a transformed sequence. I tried : ...
0
votes
0answers
15 views

Set parent by property

In the editor's hierarchy, if I drag and drop one object onto another, the second becomes the parent of the first, and moving the parent will cause the child to move. I see I can set this relationship ...
0
votes
1answer
34 views

Nested transform.position in Unity

The following code works so good , but it is so long. How can I use a for loop to write a short script for any number of prefabs? ...
3
votes
1answer
130 views

What does the Node2D transform property do?

Following a Godot tutorial I encountered the transform property, but I'm not sure what it means nor how to use it. I read the official Godot documentation, but it ...
0
votes
1answer
107 views

Creating object in front of player, with some distance

I want to create objects in front of player with some distance, so that prevents hit with player immediately. So first, I get the global player position and direction vector which player towards: <...
0
votes
1answer
31 views

After rotated by Z-axis, X/Y axis still rotating just like z is 0

I'm making aerial vehicle controller, which can rotate 3 axis: X(Pitch), Y(Yaw), Z(Roll). Rotating x(pitch) and y(yaw) axis works fine, however after I rotated z(Roll) axis, x/y rotation gave me ...
0
votes
0answers
124 views

Unwanted angular velocity in unrelated axis (rigidbody simulation)

so real quick I'm simulating 3D rigidbody dynamics. This is what I have: ...
0
votes
1answer
21 views

Changing node's translation affects to sibling node

I have a node which looks like this tree: FPSController (Root node, and it's KinematicBody) CollisionShape Camera GroundCheckRayCast When I moved CollisionShape's location down, camera also going ...
1
vote
1answer
120 views

Follow 3D Path Around Sphere

I have currently have a path that wraps around a Sphere from one side to another - this is basically a 3D highway in the sky type object that is a textured road. I have an Aircraft model that I can ...
2
votes
1answer
75 views

What are the “axes of a matrix” exactly?

I am currently learning about game engines, and for the engine math, there are functions called GetXAxis, GetYAxis, and GetZAxis that returned the X, Y and Z axes for a matrix. These functions return ...
1
vote
2answers
92 views

How can I find the offset rotation and position between two objects in 3D?

I have two objects in 3 dimensions, one of them (Child) is attached to the other one (Parent) using the offset between them (XYZ ...
1
vote
1answer
83 views

How to calculate rotations for an object with scaling transformations?

I am working on implementing scaling transformations into a game engine (C++), which previously assumed only translations and rotations. Visually, the scaling works, but a lot of the game logic ...
0
votes
1answer
30 views

Prevent Animation Tab from changing the position of an object

I am quite new to Unity. I am using the latest version. When I try to make a door open animation, it goes well with rotation. But when I add the position property it takes it to the ...
1
vote
1answer
72 views

What should the Z coordinate be after transformed by the projection matrix?

I'm working on an OpenGL 1.x implementation for the Sega Dreamcast. Because the Dreamcast didn't have any hardware T&L the entire vertex transformation pipeline has to be done in software. What ...
0
votes
1answer
74 views

Unity 3D rotating object around 2 axes rotates it around 3

I am developing a 3D space shooter and I've fount that when triying to rotate the ship using X and Y axes it also rotates on the Z axe. The answer here helped me a lot, but now when I try to rotate ...
3
votes
1answer
172 views

C++ Assimp - Transformation Hierarchy

I have a question regarding model imports using ASSIMP. I've been working on an Entity and Component (e.g. unity gameobject component) based game engine for fun and to learn in my spare time. I've ...
3
votes
2answers
97 views

Mimicking enemy boss movement of Wonderboy in Monster Land

I want to imitate the movement of the "Death" boss enemy in Wonderboy in Monster Land. At first, I thought it just moves with a sine wave, but it's not. The up and down movement is erratic. I ...
0
votes
2answers
35 views

How to access specific child indices (directly, not using tags or searches)?

I have a game object whose prefab is structured a very specific way. It is a conveyor belt. I intend to arrange them end-to-end and animate them all at once using a script. Right now I am trying to ...
0
votes
1answer
33 views

Bullet prefab gets stuck to target after hitting

As the title says, I am having an issue with prefabs: I am trying to make a bullet follow a curve and then hit a target using this method: ...
0
votes
1answer
85 views

How to create a custom set of coordinates based on two points in Unity?

As the title says, I am having problems finding a way to create a new set of local coordinates based on two points. Here is an example: Consider that the two gameObjects are not one parent of another,...
0
votes
1answer
50 views

Unity3d: Position a gameobject such that its forms a right angled triangle with other two gameobjects

How do I position C gameObject such that it forms a right angled triangle with A and B. I tried to use ...
0
votes
0answers
15 views

Performing translation after rotation on object

I'm working in Maya and I have a light object. When I rotate my light object on the origin my manipulator rotates with object. However, as soon as I translate the light object (no longer at origin), ...
0
votes
1answer
164 views

Quaternion.RotateTowards not working as expected when parent object moves/rotates

I have a Tank with a rigidbody. A Turret Base is attached to the Tank via a Hinge Joint. The below TurretController script is attached to the Turret Base in order ...
0
votes
0answers
25 views

Javascript or Animation in general tween, spring, mouse tracking, mixing

Back story. I am a web developer and i can pretty much do anything on the web. When i first started doing some programming it was in flash actionscript 3, and i was 14 and now i am 29 and still i ...
0
votes
1answer
22 views

GameObject keeps snapping to camera size on play

I'm in the process of making my GameObject move when I drag it across the screen using touch. But my current issue is when I press play to test the game, game object snaps to the size of my camera on ...
0
votes
0answers
255 views

Why isn't my custom unity skinned mesh implementation working properly?

I'm creating my own scripted implementation of a Skinned Mesh in unity for collision detection. But I've run into some problems whenever I update the vertex positions using the update armature ...
0
votes
0answers
29 views

How to implement Meshlab's rotation manipulator? [duplicate]

I want to implement a rotation handle/manipulator mechanism that would enable user to rotate a 3D model exactly like Meshlab does. Unfortunately I don't fully understand how does the rotation gizmo ...
0
votes
0answers
32 views

How to program 3D translate widget like in blender?

Im struggling to achieve the translation widget in my own render engine. Funny enough I thought that widgets are easy, but boy was I wrong... What I want to implement: Where I am having problems: ...
0
votes
0answers
27 views

Find mouse pos in 3D space?

I have a game where there is a set of tiles rotated 45° away from the camera. I want to work out what tile is being hovered over by the mouse, and for that I need to translate the mouse pos on the ...
1
vote
0answers
41 views

How can I get my player's character to slide along a rail?

I am creating a snowboarding game and would like my player to be able to jump on a rail and move along it if it lands on it. I have no idea how to approach this. I have already tried using ray casts ...
0
votes
0answers
35 views

Where to find animated matrix transformations in an fbx file?

Where can I find matrix transformation animation data in an fbx file? I have an fbx file with animations. I have successfully read the indices, matrix, and weight from it. How can I get the frame-by-...
0
votes
0answers
11 views

How to switch between 2 game object while having it move at the same position?

I've been trying to make 2 input which change the state of a game object into another by setting one active and another inactive alternatively. But when you're in one state and you try to input the ...
2
votes
3answers
218 views

Save object transform values in play mode for editor mode?

Many times I need to adjust the position or rotation angle of object in play mode but when I got back to editor mode I found all my work is gone! I looking on InterNet for a solution and I found this ...
0
votes
0answers
20 views

Transform Vector3 into Vector2 with PerspectiveFieldOfView Matrix

If I understand correctly, Matrix.CreatePerspectiveFieldOfView(…) creates a Matrix that projects a ...
0
votes
1answer
57 views

Character rotation according to camera causes rapid flipping when game starts

When I load my scene, my character rotates +90 and -90 on the X axis very fast about 4 or 5 times, and then he stops at -90 on X axis (lays back down). When I move the character, the rotations are ...
-1
votes
1answer
35 views

How can I change the direction of movement each time a key is pressed?

I would like change randomly the movement of an object every time I press Q. It seems like the code should be like this, but it does not change the direction of movement as expected: ...
0
votes
1answer
62 views

Instantiate an object and translate it randomly

My goal through this code in C # is that each time the player presses the Q I create a cube at a fixed position given by another object, then begin translating it in a random direction. ie. first ...
0
votes
1answer
46 views

pass by reference a transformation

I create a C # script in which I declare a transformation: public Transform Origin; When I put this script on an object of the hierarchy, in the Inspector a field Origin appears at the level of the ...
0
votes
2answers
104 views

Apply transform.Translate to a specified object in the script

In Unity3D, if I place a C # script including transform.Translate on an object "A" in the hierarchy, it animates the translation of this object A. How in C# can I apply that transform.Translate ...
1
vote
0answers
45 views

Matrix for transforming a square to a quadrilateral

I have a square of points {<0, 0, 0>, <6, 0, 0>, <6,0, 6>, <0,0,6>} (The square is placed at the origin in the xz plane in opengl). Want to apply a transformation/s on the square and make ...
0
votes
1answer
29 views

Model turning 2d when it's parented

I'm importing arms from blender for my first person controller but when I make the player the Arms' parent it turns 2d. I have no idea why this is happening so if anyone could help it would be very ...
0
votes
1answer
35 views

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

I found a youtube video (Sebastian Lague: Character Creation (E07: Unity character controller)) that has a really good movement script, I understood it and used it for my character. When I started ...
0
votes
1answer
384 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
137 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
50 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 ...

1
2 3 4 5
8