Questions tagged [rotation]

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

Filter by
Sorted by
Tagged with
0
votes
2answers
50 views

How to rotate an object based on the movement and angles of Lifters

I have Lifters that "carry" an object. I want the object to move and rotate based on how those Lifters move. Requirements include: Supporting 1-4 Lifters at any side of the Object (e.g., ...
0
votes
1answer
21 views

How can I get the basic Unity player controller to move based on a gameobjects rotation?

I am making a basic movement script based off of the built in playercontroller in Unity. I am trying to get the Player gameobject to move forward based on its own rotation (i.e. if it is rotated to 90 ...
0
votes
1answer
28 views

GameObject LookAt not aligning properly

I have a celestial sphere with a plane in the centre and spheres (stars) aligned around the centre with a fixed radius. In order to show the stars visible from a certain latitude and longitude from ...
0
votes
1answer
27 views

Angle object only in the X axis

I'm trying to code a turret to angle towards a target, where I have one part of the turret only rotating on the left/right, and I want to animate another part to only angle up/down. I've got the left/...
0
votes
1answer
40 views

When key pressed rotate until lifted if key up smoothly revert to original position and if rotate too far die

I am trying to have a smooth rotation animation on this hover-car to make it seem more realistic. I am trying to code it so that if the key a or ...
0
votes
3answers
46 views

How to calculate a direction that will turn a parent so that a locally-rotated child is faced in a given direction?

Imagine an old sailing ship with cannons: they're pointed out at 90° angles from the ship's hull, so in order to fire them, you have to turn the whole ship so that the cannons are pointed at the ...
0
votes
0answers
65 views

Trying to 'stamp' an arbitrary assortment of pixels to a texture2d that may be rotated at an arbitrary angle

This one is hard to explain but I'll try to not to overcomplicate it. Engine is Unity, for reference. I have a system where an object has a 2d texture to display a custom splat map. The user can '...
0
votes
1answer
50 views

How to rotate sides of rubik's cube by mouse drag?

I am trying to make a Rubik's cube simulator. I built the Cube by arranging 27 pieces in appropriate place. I wanna simulate the cube like This. This is what my cube looks like. I successfully wrote ...
1
vote
3answers
423 views

How to accurately capture the direction in which the mouse moves?

I used to play this game on Kongregate called Death vs Monstars. A tl;dp (too long; didn't play) explanation of the mechanics is that the character you control follows your mouse cursor. Your ...
2
votes
1answer
55 views

Clamp quaternion relative to plane normal

How would one be able to clamp a quaternion based on the angle relative to a plane surface (defined by a normal)? My diagram below provides more of a visual explanation of exactly what I am talking ...
1
vote
2answers
108 views

3D Camera Rotation (Unwanted Roll) - Space/Flight Cam

I am working on a camera class that will have full range of motion (pitch, yaw, and roll). When only altering pitch and yaw, I am getting a large amount of roll. I understand that the issue is ...
0
votes
1answer
25 views

Player is not looking at correct direction

My Enemy/Bot is facing the wrong direction as shown in the attached screenshot 1. Basically what I want is that Enemy/Bot gun should directly face the player, not enemy/Bot himself. Note: White line ...
3
votes
1answer
50 views

Rotate quaternion around plane normal

How can one rotate a quaternion so that the rotation is around a plane normal? A graphic/diagram I made below gives more detail about what exactly I am implying. Note that the tip of the quaternions ...
0
votes
2answers
29 views

XNA Rotate Vector2 around Origin

I have a Rectangle and a Vector2 position, my sprite is being drawn at this position. The rectangle is meant to be a collision system with the cursor, when I rotate my sprite around the origin and ...
4
votes
2answers
702 views

From 3d rotation, snap to nearest 90 directions

I have a 4x4 transformation matrix, made only from successive rotations and translations, and I'd like to "snap" my object to the "nearest" of the 24 orthogonal (multiples of 90 degree) rotations. I'...
1
vote
3answers
3k views
1
vote
1answer
328 views

What are spline input keys?

There isn't a really adequate explanation of these anywhere on the internet, so I thought I'd ask this question here. What are spline input keys in Unreal? How are they represented in Unreal? Also: ...
0
votes
1answer
38 views

Is it possible to work out rotate in degrees per second based on this rotate logic?

I have this code to rotate an object towards another at a given speed. ...
0
votes
2answers
68 views

Rotating on a slanted surface?

I want to rotate (change it's yaw) an object when its sitting on slanted ground. Pretty much I want to rotate around the ground's normal. Right now I ray cast down, get the ground's normal. Then I do:...
0
votes
0answers
20 views

How to rotate a rigidbody with a Pid controller

I would like someone to describe me how to use a PID controller to rotate a rigidbody with AddTorque to a specific position. (like a spacecraft that rotates the Y axis of rotation towards Camera....
0
votes
1answer
19 views

Change item rotation axis in inventory item visualization

I'm learning unity and i'm trying now make an inventory, i made a simple interface, and now i'm trying to make a item visualization. I look for some codes from web and i found this one: ...
0
votes
1answer
100 views

How to Reset Position Of my player?

Link:https://academo.org/demos/rotation-about-point/ ...
1
vote
2answers
154 views

Camera Aligned To Sphere Surface

I am writing a planet renderer and have come across a problem that is really limiting the usability of the program. When I am on the planet (anywhere but the north pole) I cannot rotate the camera to ...
0
votes
1answer
80 views

Rotate Rigidbody to face away from camera with AddTorque

I have a camera that rotates around an object with "Look At" . I want the object to rotate to face the direction the camera is pointing (Camera.main.transform.forward) using AddTorque, but I can't ...
0
votes
1answer
101 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 ...
0
votes
0answers
36 views

How do I determine the forward/right direction when I have the “up” vector? - Unity

I am trying to fix a gameobject for e.g. a cube (which i am using as a sensor) on my character. I need the cube to rotate (with orientation control from the inspector - I have a public quaternion ...
3
votes
3answers
675 views

libGDX - How to rotate with a specific duration

I want to rotate my player to 90° for a specific duration. I know scene2d provides this, but I don't want to use it for my players. With how much to rotate every frame, so after x seconds the ...
0
votes
1answer
24 views

How to keep the object rotation while using RotateAround in Unity?

I've got an object that has a comet-like sprite rotating around it. I'm using this code in LateUpdate() to make it rotate and keep the comet's tail at the right ...
0
votes
1answer
53 views

Rotating objects in an random rotation around center point

I almost have what I'm looking for. Still trying to understand rotation and spawning of objects. I have a ground field with a number of spawn points (and they are placed randomly in a circle). It's ...
1
vote
2answers
2k views

How to rotate a local position offset based on a direction vector?

I'm trying to fire three raycasts in the direction of movement, from offset starting points. I'm having trouble calculating the start positions of the rays based on the direction. As you can see in ...
0
votes
0answers
76 views

Prevent sprite from rotating with camera

I am creating a small 2d game and looking for a way, to prevent certain sprites from rotating with the camera. I could not find any settings that would allow me to do so, so my next best guess would ...
0
votes
1answer
15 views

How to scale smaller values more

Hello it seems like it should be easy and i am missing something but i really couldn't find a solution as i am fairly new to programming. So basically i want to rotate a object faster when its closer ...
0
votes
0answers
20 views

Rotate 3D object along Perlin noise direction

I have a 3D object I'm moving with a noise function and I would like it to face the direction it is moving in, so far I broke down the problem into the 2D plane. I did this for the xy plane and the xz ...
4
votes
1answer
1k views

Why is my model rotating opposite direction around the Y axis?

I have a simple scenario. I have a simple scene, and in it I'm drawing a grid and a model, with some axis for orientation. I noticed when I rotate the model about it's local Y axis, if I rotate the ...
0
votes
1answer
51 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
31 views

Handling rotation interpolation at 180 degrees

I currently have a scene where 3d a gents move throughout a grid, each time they move that can pick a random cardinal direction up,down,left or right. They then rotate to face that direction using <...
0
votes
1answer
393 views

Problems when rotating object to animate in Unity

I am trying to create some animations for a car model in Unity and I have a problem with the rotation of the wheels https://imgur.com/a/HcWxyob Here I can set the rotation properly as the pivot ...
1
vote
1answer
233 views

Calculating real time moment of inertia around arbitrary axis in 3d

I have a 3d rigid body consisting of multiple triangles forming a closed mesh. I know how to calculate the moment of inertia around an arbitrary axis by splitting up the mesh into simpler shapes and ...
7
votes
2answers
3k views

Matrix rotation wrong orientation LibGDX

I'm having a problem with matrix rotation in libgdx. I rotate it using the method matrix.rotate(Vector3 axis, float angle) but the rotation happens in the model orientation and I need it happens in ...
0
votes
1answer
242 views

Quaternion.LookRotation with Joystick

I am having an issue i cannot seem to figure out within my code. What this code does at the moment is that it rotates the 3D Model around the z axis but i need it to rotate around the y axis. Any help ...
0
votes
1answer
42 views

Controlling Unity 3D cube with remote gyroscope

This probably will go into conceptual things as well, but what I would like to do is take a Raspberry Pi (with a Sense Hat), transmit the gyro values to Unity, and effectively have a 1-1 realistic ...
1
vote
1answer
63 views

Third Person Flying Camera

I am having issues creating a third-person camera for my Rogue Squadron (N64) like game. First I have posted my issue on the official Unity Answers site here. So far my ship is behaving as I want and ...
3
votes
3answers
487 views

How to keep track of camera's rotation while it's being rotated?

I'm building a 2D game where the sole interaction of the player is rotating what they can see (this is currently the camera, though it could be the world) by plus or minus 60 degrees. My current ...
1
vote
1answer
30 views

Scaling a rotated child with parent-child transforms

In unity, if you parent something to another object, then give the child some rotation, and scale the parent, the scale applies to some arbitrary axis to the child, here's some pictures to demonstrate:...
0
votes
1answer
48 views

Calculating unit wheeling

The user clicks a unit to select it for a move. Its going to move to wherever they click next. It's centre c is point cf They then click a point it is to move to. This is to be where the unit centre ...
4
votes
1answer
917 views

How to correct this issue with a top-down aiming angle in Unity - 2D?

I'm trying to build my first project and I'd like some input for a math correction. The game is a top down 2D shooter, a bit like the iconic "chaos engine" from SNES. The issue is that either the ...
1
vote
2answers
2k views

How to move a player along Waypoints with Rigidbody.MovePosition in Unity?

I have a player with a Rigidbody, I want it to follow along the Waypoints. I have used MoveTowards but it seems also not to work however. I want to use MovePosition to add force while grinding. I ...
0
votes
0answers
13 views

Quaternion.Slerp only moves halfway

I want to rotate my object by either 90 degrees on the y axis when pressing right or -90 degrees on the y axis when pressing left. I want to do this smoothly so I'm using Quaternion.Slerp. But, on the ...
3
votes
2answers
9k views

Direction vector to quaternion

I have a unit vector (direction) which represent a rotation around Y axis, and would like to turn this into a quaternion to represent the same rotation. I use GLM library, but interested any library ...

1
2 3 4 5
19