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
1answer
39 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
27 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
120 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
19 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
54 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
65 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
62 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
69 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
29 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
52 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
60 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
86 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
95 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
33 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
32 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
47 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
13 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
80 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
17 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
21 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
75 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
21 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
20 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
26 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
40 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
30 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
101 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
44 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
34 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
42 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
40 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
83 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
42 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
25 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
221 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
31 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 ...
0
votes
0answers
134 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
129 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
34 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
28 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
31 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
151 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
121 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
732 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
95 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
28 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 ...