Questions tagged [rotation]

Rotation is the circular movement of an object around a specific axis.

Filter by
Sorted by
Tagged with
0
votes
0answers
8 views

How to fix roll in FPS camera when looking sideways [duplicate]

I am trying to calculate the rotation for an FPS camera. My closest attempt was to create a some Euler angles(from input) and multiply that with the view matrix, this works, but only if I am looking ...
0
votes
1answer
77 views

Why are rotations in 2D game engines often counter-clockwise = positive systems?

I was looking over the API for a game engine a friend was developing in her spare time. She made the decision to make positive angles rotate in a clockwise direction. This immediately struck me as odd....
1
vote
2answers
65 views

Rotate object always at same speed on screen, no matter camera distance?

I am rotating a globe like XCOM's hologlobe, I rotate it using Quaternion.RotateTowards(Quaternion from, Quaternion to, float maxDegreesDelta). I found a good value for ...
1
vote
1answer
40 views

Rotate Sprite towards mouse cursor SDL

I have trouble to make my sprite(Arrow) to point at the position of my mouse cursor but i don't get the Right results. I've tried this: ...
0
votes
1answer
51 views

How can I match the delta rotations of two objects?

Here is the code I'm starting from: ...
0
votes
0answers
34 views

How do I make a Transform object follow it's parents rotation

So basically i have a transform object parented to a gun. I use this transform to determine the position my bullets are spawned in, and their rotation. The position part of it works fine, but the ...
0
votes
0answers
24 views

Tilt car to accomodate for larger Tire

I would like to rotate the car so that the front wheels are touching the ground without using physics. As you can see i want to rotate the car by angle a, but making sure that both tires are touching ...
1
vote
1answer
21 views

Rotate a 2D object slowly to the touch position in Unity

I am creating a circular Joystick like setup in Unity. Played a lot with it in different ways but I don't get the desired results. ...
0
votes
1answer
26 views

Trying to rotate a point around another point and it's not working

I am trying to make a function to rotate a point around another point. My maths are very rusty but i did some research and i just dont understand why my function is not working. ...
0
votes
0answers
31 views

Unity : Rotate object on touch looks weird

Touch and hold the screen then rotate object continue("Object is unity default cube") that's my operation, but when object is Rotate then it's look like weird. I ...
0
votes
0answers
24 views

Unexpected changes in Ai population

I've been trying to do my first evolution script. I want my population to learn to walk in 3d space. I am getting issues with the movements and the mutation. In my script, they evolve based on certain ...
0
votes
1answer
45 views

Rotate an object on itself, from one random Quaternion to another

I have a situation: I have a 3D object in the world. let's say a sphere. I have 2 random directionnal vector: vector A, and vectorB: My question is: How to I rotate over time my object, from A to B ? ...
0
votes
0answers
9 views

Rotate to face the bottom of a unit towards a planet [duplicate]

I would like to have tanks that move around on a planet (a sphere). Depending on where the unit is, I would like it to always have the bottom of it facing the center of the planet. To do this I've ...
1
vote
1answer
29 views

Upper & Lower angular limits on Y and Z axes

My Task: I'm trying to replicate this project. I'm using unity as my physics engine. Currently I'm still learning how to work with the different joints unity has to offer. The type of movement I'm ...
0
votes
0answers
23 views

Unwanted rotations with transform.RotateAround

I didn't tough i would have issues with this, but unfortunatly I did. I have a Character (which is more a pile of cube) with a body, a empty GameObject for each leg attached to the body with a join ...
0
votes
0answers
9 views

Object transform rotation around correct pivot, but wrong pivot after colliding

I'm messing around a bit trying to create a table football table. So this involves create rods with players on them. The rod should be free to rotate around the Z axis with the players moving around ...
0
votes
1answer
45 views

Rotating Sprite Around A Point Without Messing Its Drawing Point

I am trying to draw and rotate an arrow sprite based on a point,around a static circle body without messing its drawing starting point. Arrow should be directed to the same direction with user touch ...
0
votes
1answer
44 views

Rotating a parent rectangle to align child with target

My beautiful drawings will explain better than many words (or at least I hope): The structure: The black rectangle is a GameObject (my weapon sprite). A and ...
0
votes
1answer
48 views

OpenGL object load in reverse

I am trying to load a model and it is loading it in reverse. When I am trying to rotate it 180 degrees it changes the lightning as well. I am not sure what I need to do to change the position that eh ...
0
votes
1answer
44 views

Tilting a game object left/right/forward/back with gyroscope, regardless of player's heading

I'm working on a mobile game in Unity and using the gyroscope to rotate an object along the x and y axes. ...
0
votes
0answers
123 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
0answers
18 views

Unity3D: Rotating the head and an animation gets clashed

A rigged generic models head keeps rotating to follow the camera. When there is an animation like shaking the head, the head animates weirdly as compared to without rotation. Is there anyway to fix it?...
0
votes
0answers
42 views

Logic behind a cubic reflection

I'm creating a cube in WebGL made of mirros that have to reflect the object inside of it. At the moment I'm stuck because I don't understand the correct logic to implement to achieve the result. I ...
3
votes
1answer
56 views

Why does the object rotate to a random direction when I start dragging?

I'm trying to do drag to rotate sort of thing, so far the code is fine. However when starting to drag (left clicking first), the object rotate to a random direction first which looks odd. here is my ...
0
votes
1answer
51 views

Unity 2D Rotating Cannon to Mouse Position Inaccuracy Issue

I am trying to rotate a 2D cannon to clicked mouse position and having accuracy issue. It's working but the angle seems to be losing more and more accuracy when I move the mouse to further up or down ...
2
votes
1answer
58 views

Limit rotation angle

I am currently trying to rotate the weapons of a spaceship towards the mouse position, but in order to avoid the collision of projectiles with the ship I want to limit the angle the weapon can turn. ...
0
votes
1answer
25 views

Transform.RotateAround with Joystick Rotation

I want to rotate one object around another, so that it matches my current joystick rotation. I know Transform.RotateAround does this but I can't seem to find a way ...
1
vote
0answers
42 views

Adding vectors and applying rotation matrix using quaternion

I have a problem and looking for help, see attached image. I have a number of points (x,y,z) which are treated as connected vectors (first point as first vector base, second point as first vector end ...
1
vote
1answer
118 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 ...
0
votes
1answer
49 views

CharacterController rotation with mouse

I'm trying to rotate my characterController around with the mouse movement. I've tried to do so with this: ...
0
votes
0answers
24 views

Camera rotation to match UVs of a point across different FOV

I'm looking for the formula needed to calculate the amount of camera rotation required to display a point at the same UVs across two cameras with different FOVs. I can't modify the projection matrix ...
1
vote
2answers
77 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
87 views

How to stop scrolling of text in OpenGL

I want to set a time limit for scrolling text in OpenGL & GLUT. How can I stop scrolling at 250? Here is my code. I try with the if condition but it's not working. The scrolling is not stopping in ...
0
votes
1answer
68 views

Moving an Enemy Toward the Player but only in cardinal+diagonal directions

I am working on a "quick project" to get my feet wet and to put something finished in my projects. I want to make an enemy that constantly tries to be aligned with the player object, but doesn't ...
1
vote
0answers
125 views

How to make a top down 2D ball rolling

I am developing a top down game similar to 8 pool billard with libgdx and box2d. How do i make a 2d ball texture look like its rolling when force is applied like this: So it feels actually 3d ? For ...
0
votes
1answer
49 views

how to move character move on a circular surface in only one direction?

Making a 2d game: I want to move character on circular surface only in one direction? Script attached to child object is: ...
0
votes
2answers
52 views

Objects aren't rotating in sync

This is a follow-up question to How to reapply force applied to one object to another object I want to make two objects move, react to collisions and other stuff as if they were one. For example, ...
0
votes
1answer
64 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 ...
0
votes
0answers
16 views

Rotating cube as child of another gameObject results in it skewing in 2 of 3 axes [duplicate]

I have added a cube and changed its scale and position but not its rotation. I added a second cube as a child of that first cuboid. I was hoping to rotate it but instead it just skews the second ...
0
votes
1answer
74 views

How to Reset Position Of my player?

Link:https://academo.org/demos/rotation-about-point/ ...
0
votes
1answer
118 views

Clockwise / counter-clockwise convention for Vector2.Rotate(float angle)

I am making a 2D game in Unity, and from what I understand, their convention is that an angle of 0 is up and increasing the angle rotates the object counter-clockwise. Sidenote: I made this ...
1
vote
0answers
69 views

How to calculate the torque required to rotate rigid body about constant axis and rotating axis?

How to calculate the torque required to rotate rigid body about constant axis and rotating axis? Convention: Identity Rotation Matrix: ...
6
votes
1answer
1k views

Unity: transform.LookAt(target) not “looking at” target?

I have been troubleshooting a prefab for several hours and am out of ideas. It concerns a method that I thought I was comfortable with, transform.LookAt(target). I have this prefab: As you can see, ...
0
votes
1answer
32 views

How to construct this collision vector?

I have a 3d game, but for movement I use only two axes (X and Z) - X is vertical, Z is horizontal Here's what I'm trying to achieve: Player is the circle, InputDirection is Blue, NewInputDirection ...
0
votes
2answers
50 views

How to limit camera pitch (x rotation) between two angles

I use this script rotate the camera on its local X axis: float v = verticalSpeed * Input.GetAxis("Mouse Y"); transform.Rotate(-v, 0, 0); Right now this lets ...
0
votes
1answer
74 views

How can I move and rotate an object along with another using vector math?

How can I move and rotate an object along with another using vector math? This is using Godot 3.1 using a KinematicBody2D as a ship with a ...
1
vote
0answers
27 views

Polygon doesn't bounce enough in edge-ground collisions (but it does in vertex-ground collisions)

I'm currently making a (basic) physics engine in Python in which I want a polygon to bounce off the ground (\$y=0\$). When a vertex hits the ground, I apply the (linear) impulse $$\overrightarrow{P}...
0
votes
2answers
101 views

How to convert Blender rotation angles to Unity rotation angles?

I add news cameras in my game. I have a problem with rotation, the result is not alway the same as in Blender. I tried lot of ideas but today I do not have anymore. Cameras 1, 2, 4 : good rotation ...
0
votes
1answer
121 views

Unity: 'Quaternion.RotateTowards' animation is too fast (instantaneous)

I have a 'block-on-a-hinge' scenario where I just want it to smoothly rotate into the position of a stair step. I messed with this for a day and finally verified that my start and end angles are ...
0
votes
0answers
26 views

Why is not the projectile going toward the target?

I have a project where I can shoot (with a simple projectile). Character Blueprint (generate projectile): However I would like to be able to make the projectile go towards a specific target. ...