Questions tagged [rotation]

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

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

How to recovery rotation to zero

I tried to rotate the objects in world space and restore them to 0, but if the order of restoration is not the same as the order I set before, I can't restore them. How can I solve this problem please?...
0
votes
2answers
51 views

Shooting from Gun in LibGDX

I'm trying to shoot a bullet from the tip of a gun. This gun is a Sprite object and it is constantly being rotated to point towards the mouse. The issue is that the point to shoot the bullet from is ...
0
votes
0answers
17 views

What math function represents Minecraft bow angle/height?

I am working on a mod in Minecraft Forge/MCP using Java. Aiming a bow is controlled by your head pitch and yaw rotation. Right now I have a math function that automatically looks at the target. But I ...
0
votes
1answer
16 views

Get Angle offset [duplicate]

I'm working on a game where the input is done via a joystick. Normally, one would snap the players rotation to the angle that the joystick is pointing, but for my game's purpose, I have to lerp to the ...
0
votes
2answers
40 views

Rotating only 2 axes of rotation quaternion to "point" in a direction

Note: I am using the Unity DOTS ECS framework, which contains less maths functions, but I can probably implement the same functions from standard unity if the code is public. This question is not ...
0
votes
1answer
34 views

How to interpolate smoothly between two yaw rotations less fast in MCP/Forge?

I am coding a custom client for Minecraft using MCP. (Please no hate, I'm not making a hacked client!) I have two variables currentYaw which is the current yaw ...
0
votes
0answers
45 views

Reset rotation does not work properly

I have a unit, that targets enemies by turning it's upper body at them using LookAt. Whenever the unit dies, it plays two animations (one for the lower body and one for the upper body), which in most ...
1
vote
2answers
45 views

Limit rotation/direction of two axes with seperate values (Vector3)

Issue I'm trying to create a vector pointing in a direction towards a target, and then using that vector rotate a child transform to face the target while limiting the rotation on the X and Y axis, ...
1
vote
0answers
43 views

Forward movement while rotating lead to flickering

I'm trying to make a ship move forward while also turning, but when I start to play, the ship flickers when it tries to move and turn at the same time. (as comments suggested, I added other code for ...
-1
votes
2answers
62 views

Parent object does not rotate on its own axis with its children. How do I fix it?

My parent object components: Rigidbody2D and the script I shared below. Children(Head, Body, Arm, Backpack...): There is only collider. There is no rigidbody2D. (I want the parent object to use the ...
1
vote
1answer
68 views

Player rotation recalculation causes jittering on edges

When my player walks around a circular planet everything works well, but when my planet is a shape like a cube or a dodecahedron, even with smoothed edges, my character jitters if I walk slowly on the ...
0
votes
1answer
27 views

Rotation matrix for a model where the forward axis is not +X

I'm trying to convert a normalized unit vector, representing an entity heading, into a rotation matrix for rendering. The problem is that I'm using an (apparently) unusual forward vector for my ...
0
votes
1answer
27 views

Keeping two triangles with different scale attached during rotation

I'm making a simple Lunar Lander clone. The ship is a triangle, and I'm trying to draw the exhaust fumes of the ship. I'm wondering how to draw the exhaust so it's always relative to the ship. I'm ...
1
vote
2answers
103 views

Simulating a rocket out of control in Box2D

In the void of space, a spaceship releases a rectangle shaped space-torpedo. In half a second, it starts its rocket engine and goes straight until something get in its way, and then boom! The code ...
1
vote
1answer
43 views

3D AxisAngle spins at 180 degrees

I am using the Axis Angle technique on objects so that they are oriented away from a planet surface like in Super Mario Galaxy. I am using two unit vectors [0,1,0] and a normal vector from the planet. ...
1
vote
1answer
24 views

Unity Camera resets rotation instead of using existing values

I'm working on a generic camera rig using mouse inputs, kind of like an RTS camera but it will be used to look at models with as a sort of turntable viewer. The issue I am having is that when I rotate ...
3
votes
1answer
87 views

Why my player can suddenly fly?

I'm working in a project with Unity 2d where player walks on a small planet. I try to use some code from youtube tutorial to apply gravity to my planet.This code consists of two parts, Attractable and ...
1
vote
2answers
48 views

Reorientation when rotating Transforms around another Transform without parenting

The functionality I am trying to implement, consists of rotating one Transform and appling this rotation to other relevant Transforms in the scene. To make it a bit more clear: I have several objects ...
1
vote
0answers
20 views

How to calculate local orientation of child relative to parent from only global positions?

I am trying visualize a human finger's pose with a 3D model in Three.js. The 3D model is composed of 3 bones that represent the proximal, middle, and distal bones of the human finger, connected in ...
1
vote
0answers
12 views

how to make an axis from one gameobject the same as the axis from another gameobject

I am making a third person script in unity and I want it so that when you aren't moving you can pan around the player and when you are moving the player faces in the opposite direction to the camera ...
0
votes
0answers
56 views

Unity 3D - Make character look at mouse with New input system/Character Controller

So I've been trying to make a top down game with the new input system. Been trying to make the character rotate and look at the mouse's position. The player moves on the x and z axis, with the camera ...
0
votes
0answers
26 views

Problem with rotation to normal for FPP character controller

I want to create a first person perspective character controller that allows for walking on walls and ceiling by transitioning with a slope (kinda like the anti-virus levels in Rachet & Clank: ...
2
votes
1answer
77 views

Pygame 2D : rotation around center not working properly

here is the code I use to rotate an image around its center: ...
1
vote
1answer
105 views

Creating a custom camera in Godot

Allow me to start with what I'm trying to achieve - there might be an easier way to do this and I'm just overcomplicating things. I'm trying to implement a camera, that will be able to rotate around a ...
1
vote
1answer
31 views

How to set transform.up without locking the y-axis?

I'm trying to make an object's transform.up to a normal of the raycastHit point. I tried using this line of code: ...
3
votes
0answers
41 views

What is wrong with my collision resolution function?

I have been able to implement the following linear collision resolution function, based on these tutorials, for a given pair of in-game objects that gives good results: ...
0
votes
1answer
61 views

What happens if first we scale a rotation matrix and then multiply it with an object?

This question has been bothering me lately. I know the correct order to scale, rotate and transform a matrix but the question I have is very different. What if we first scale our rotation matrix by ...
1
vote
1answer
41 views

Find the vector orthogonal to a quaternion?

Apologies if the title doesn't quite make sense, it's been a long time since I did any 3D stuff. I would like to be able to pan my camera up and down with the arrow keys. The camera's rotation is ...
0
votes
2answers
63 views

2D - How to make a gun muzzle aim at the mouse when the rotation pivot isn't on the muzzle?

I'm making a simple 2D shooter game in pygame and I've come across an issue when making the character aim its gun at the mouse. To make the gun aim up and down, I've set it so that the gun uses the ...
0
votes
0answers
33 views
0
votes
1answer
38 views

How to rotate the transform only on the Y?

...
0
votes
1answer
142 views

Get a Vector2 Based on Object Rotation in Unity

I feel like there is an obvious answer to this but I can't find it. Is there a function in unity that gives you a Vector2 (or 3) based on the rotation of an object. for example: z rotation = 0 ---> ...
0
votes
1answer
65 views

Calculate how many degrees a physical device is off centre (offset) given X, Y, Z

Let's say I have a physical device that I can rotate with my hands and receive X Y Z coordinates of that device. What I need to calculate is the offset - how far is the pendulum of gravity straight ...
0
votes
1answer
32 views

How to I make MOUSEY look up

I have MOUSEX worked out perfectly, it moves on the X axis, but when I add the Y axis, I can't use the MOUSEX axis. ...
0
votes
0answers
96 views

How to use SetBoneRotationByName() to rotate a single bone in a armature?

I am very excited to finally be learning Unreal engine development! But I have been working with Unreal editor for only the past couple of days but am having trouble understand how to rotate or ...
1
vote
1answer
55 views

Rotating 3D Object Towards Swipe Direction

I have a character that has a constant speed, and I want to be able to change its direction with swipe gestures, The exact same mechanism implemented here. I managed to do that for movement only, ...
1
vote
1answer
68 views

Need help getting an objects orientation / all my OpenGL rotations are reversed

I'm using OpenGL on Ubuntu Linux with the Eclipse IDE and the GCC compiler. I am bringing blender models into a homemade renderer/game engine. I parse a text file containing object descriptions to ...
0
votes
1answer
150 views

How do i easily clamp my cameras rotation when using transform.rotate()

I'm making a fps controller, and I'm trying to clamp my cameras x rotation. Here's my code so far: ...
0
votes
0answers
5 views

ARCore: Differentiate between two planes detected in adjacent vertical walls in the room

I'm working on Vertical plane detection. When I'm pointing at wall 1 of my room, plane1 here is the vertical plane detected in wall 1... I'm recording the quaternion via this formula ...
1
vote
1answer
72 views

How does Unity know where the character is facing?

I just learned Quaternion.LookRotation and it's used for rotating an object. I used it to face my character in the direction where it's moving, but I couldn't ...
0
votes
0answers
26 views

Rotating with a preferred direction [duplicate]

I do a RayCast to the terrain and then use the RaycastHit.normal to plant flags. I would like to have the flags to point up with the normal, but have them all face the same direction. As seen in the ...
-1
votes
1answer
52 views

What is the relationship between gimbals and Euler angles?

Through reading a lot of articles, I understand what gimbals are (at least I think so). And I know that Euler angles follow the rules of gimbals, but why? Why do Euler angles comply with the rules of ...
1
vote
1answer
63 views

How to best simulate the space in a boxing game to account for footwork and angles?

When trying to prototype a (top-down, so far) boxing simulation I've run into a huge roadblock with trying to set the space in which the boxers will fight, because it's important for the fighters' ...
0
votes
1answer
38 views

Head rotation according to weapon sight

I have a 2D game and I'm working on head rotation with my newbie coding skills. My Player has child sprite object called DefaultPistol (which is the whole arm and ...
0
votes
1answer
52 views

Rotating fps rigid body on the Y axis

I'm currently attempting to make a first person character using a rigid body. I am aware that the character controller exists, but I believe my game will be very physics based so it's better if my ...
1
vote
0answers
19 views

How to create a joint, where the rotation of one object is relative to the other?

I would like to create a top down view scene, with one rectangle (top) is on top of an other (base). There is a joint, where ...
0
votes
2answers
54 views

how can I rotate a tetrahedron's vertices so that it's pointing straight up?

I am trying to render an Equilateral triangle in 3D, and I came across this answer: https://math.stackexchange.com/a/562895/15497 So based off of that, I made my vertex points: ...
0
votes
0answers
21 views

What is the simplest way to rotate a 3D point arohnd another point given a quaternion?

I am weak in understanding quaternions however I am learning. Right now, I know how to rotate a point around another point given an angle represented by a Vector3 using a rotation matrix. However ...
0
votes
1answer
33 views

Why does my object rotate too fast?

...
0
votes
1answer
14 views

How can I rotate the two endpoints of a line around the line's center in 3d?

The object is a capsule. I have the position of the object vector3, and the orientation of the object, a quaternion. I want to construct a line which goes through the middle of the capsule with the ...

1
2 3 4 5
21