Questions tagged [rotation]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
4 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
0answers
21 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
41 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
43 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
35 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
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
0answers
15 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
55 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
30 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
55 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
0answers
9 views

Transform.RotateAround with Joystick Rotation

I want to rotate an object around other that matches my current joystick rotation. I know Transform.RotateAround does this but I can't seem to find a way to match ...
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
76 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
30 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
23 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
64 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
82 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
50 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
78 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
49 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
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 ...
0
votes
0answers
15 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
59 views

How to Reset Position Of my player?

Link:https://academo.org/demos/rotation-about-point/ ...
0
votes
1answer
41 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
61 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
712 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
27 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
44 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
59 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
80 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
63 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
25 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. ...
0
votes
1answer
41 views

Unity3d: Find which gameObject is in front

I have two gameObjects A and B. They are rotated at <...
0
votes
1answer
34 views

How can I use a coroutine and GetAxis to rotate a game object?

For the sake of learning about coroutine, I want to convert the following to a cleaner Update that just calls a coroutine. How would I do that? ...
0
votes
1answer
48 views

Rotate coplanar 3D points to XY

I have a set of 3D points. All these points are on the same plane. I have the normal of the plane. Now I need to rotate them in such a way that the Z value of all these points become zero. (that is, ...
0
votes
1answer
46 views

Rotate mesh to normal

I have some instanced geometry (basic tube meshes) laid out in a grid, and I have a noise texture (normal map) that I want to use to rotate my instances with. So head pixel in my texture is a normal ...
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
86 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
1answer
83 views

Quaternion rotation is inverse of what I expect

I'm trying to learn quaternions and decided to implement my own quaternion class. To test it I made a couple vertex shaders, one that gets a model matrix (calculated from the quaternion) and another ...
0
votes
1answer
109 views

Two Points Rotating Around Circle?

Currently I am working on a 2D game just like duet game, it is my first game (Unity 2D). When I press left key both points rotate fine. But when I press right, the points are not rotated. So my ...
0
votes
1answer
74 views

Strange problem with rotation missile | unity3d - c#

I have a vertical missile with launcher that should find closest target and fire it's rocket to hitting target! I use complete code of this 12min tutorial for launching my rocket, and the different ...
0
votes
1answer
50 views

if rotation < -45 && > -140 issue

I have a problem with this if statement. If the rotation is < -45. And > -140 Then this statement would be true when the rotation is = -90? And it would be false if the rotation is = -170? I'm ...
0
votes
1answer
87 views

Mouse drag rotation script doesn't work when attached to OBJ model

I am new to Unity. I imported an OBJ model and assigned materials to it. I want to rotate it using the mouse in the game, using this script: ...
1
vote
3answers
168 views

How to make TEXT RENDER stand facing the camera of my character and also for the camera of simulation?

I have an actor (Minion) with a Text Render just above it mesh: As you have seen, I defined your rotation as absolute, so the text does not rotate along with the actor. In the game the rotation ...
1
vote
1answer
195 views

how to clamp the look at function?

how can i look at a target on 2 axis but clamp the the object's rotation ,to only rotate from -45 to 45 on x and from -60 to 60 on y axis. i used this script to look at target and clamp the rotation, ...
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
1answer
43 views

Quaternion rotation around center, undefined behavior

Here's my code: ...