Questions tagged [rotation]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
34 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
12 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
28 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
58 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
102 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
48 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
44 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
29 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
90 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
57 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
12 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
21 views

Quaternion rotation around center, undefined behavior

Here's my code: ...
0
votes
0answers
33 views

The X axis becomes the Y axis after a quaternion rotation

I am making a FPS game, and I have a for loop where I place out "ground" objects. (pseudo code) ...
0
votes
1answer
35 views

Rigidbody character rotation

How could I rotate my character that I'm using a rigidbody to move. I tried using transform.eulerAngles and changing those but the camera feels very jittery.
0
votes
0answers
9 views

Rotation Freakout using Constraiend Rigidbody and VRTK_FixedJointGrabAttach

YouTube Video Demonstrating Error Constraining the ridigbody along certain axes. Used with VRTK: FixedJointGrab. Tried both precision grab and normal. Only freaks out when 1-2 rotation axes are ...
0
votes
1answer
49 views

Applying Y offset to rotation / position script

I'm using the script stated below to move a spray bottle around a head. The code works fine: I have assigned the script to the spray bottle, and I have set the head as the target. However, I was ...
0
votes
1answer
30 views

Adding -90 degree Y rotation into script

I'm using the following script to move a spray bottle around a head. It should looke like in a barber shop. The code works fine: I have assigned the script to the spray bottle, and I have set the ...
0
votes
0answers
59 views

Quaternion Rotation after performing previous rotations

Have Quaternion \$ Q\$ which is rotated on the \$X\$ axis 90 degrees. \$Q\$ is now \$ (0.707106, 0.707106, 0, 0)\$. I want to rotate \$Q\$ another ...
0
votes
1answer
23 views

Does CharacterController benefit from adding lerp?

Does CharacterController benefit from adding lerp? as in this script. ...
0
votes
0answers
13 views

Unity MainCamera won't rotate

I'm making a player-script/FPS in unity where you walk around with WASD and rotate the camera with mouse x/y axis. The "character"/"Player" should be able to rotate with the mouse X axis. (E.g If you ...
2
votes
1answer
34 views

How do I calculate vehicle rotation when two car wheels are on the ground to simulate gravity?

I'm writing some code to simulate a vehicle (tank or car) driving over a heightmap terrain. I'm not using a full physics engine, and just simply checking the height of the terrain at the 4 bottom ...
0
votes
0answers
9 views

Issues with Flashlight Handle position with player rotation

I want the flashlight to look same while looking up and down as when looking straight. Normal Position for Hand and flashlight: Looking up and down, position is completely off: More images for ...
0
votes
0answers
23 views

Unity: How do I fix the players model rotation in a NetworkManager to spawn properly?

How do I fix the players model rotation in a NetworkManager to spawn properly? I created a game with the NetworkManager code. Player Model is a cone I made and imported. all works fine but when the ...
0
votes
2answers
38 views

How to detect whether a transform has rotated left or right

I have a game object in my scene, and I want to know how can I calculate whether this game object rotating to the right or to the left. For example : ...
0
votes
0answers
18 views

Joystick Orientation Wrong After Camera Rotation

I am using a virtual joystick to move & rotate the player and a touch swipe system for the camera rotation, The problem is that when I rotate the camera (Let's say I rotated the camera to 45 ...
0
votes
1answer
42 views

How to rotate two textures at once in Libgdx, while keeping their relative positions the same?

I am trying to develop a game with cards, where the user can swipe left or right to tilt the cards like this. The red & white cross should stay in the same position on the yellow card as they tilt ...
0
votes
1answer
39 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 ...
0
votes
0answers
71 views

How to rotate after a rotation in Godot / GdScript?

This 3D mesh is rotated by 45 degrees on the Y-axis. The camera follows the same rotation, resulting in these images Now I want to make the mesh rotating parallel to the camera. That is, if the ...
0
votes
1answer
26 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 ...
0
votes
1answer
28 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:...
1
vote
3answers
98 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 ...
0
votes
1answer
59 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
2answers
42 views

How to calculate turret position after rotation

I'm trying to make a tank character for my game but I couldn't do the math of firing bullets from turret instead of center of the tank. I tried some Stack Overflow solutions but I couldn't understand ...
0
votes
1answer
91 views

How can I rotate my character so that he is facing the mouse?

I just want to preface this by saying I am very new to pygame. At the moment I have calculated the angle that I need to apply to my character so he can rotate but I am unsure how to actually make ...
2
votes
2answers
47 views

Rotate on one axis, but visibly keep the other axes stable and editable

It's been a long two weeks. Quaternions are freaking complicated. I've managed to make a few baby steps towards finishing my project, but I've hit a brick wall and could use a few of your beautiful ...
0
votes
1answer
31 views

How to calculate/structure/define rotation vector for OpenGL / WebGL

I am trying to define the buffer data for WebGL and want to have in there something that encodes the fact that an object might be rotating. So it makes me think of angular momentum. So if you have ...
0
votes
1answer
68 views

How do i make enemy tank to follow and face player tank?

I'm creating tank game demo , in game i want enemy tank to always face toward the player tank. I already check look_at() function but it will face immediately, i don't want that. I want enemy tank to ...
0
votes
1answer
34 views

Z rotation matrix inverting object

I'm currently creating a 3d game where I need to rotate shapes. To do se, I created a rotation matrix for each axis, X, Y and Z. X and Y are giving me expected results, but not Z who kind of "inverts ...
0
votes
1answer
34 views

Rotate an object smoothly by using Accelerometer Input in Unity

There is a simple script where the object orientation is equal to the mobile devices orientation. it works but the object doesn't rotate smoothly. ...
0
votes
1answer
15 views

Issue with script recognizing particular z-axis rotation angles in Unity

I'm trying to make a simple flowing pipe-style rotation puzzle, but having issues getting Unity to properly recognize certain angles of rotation. My rotation script for the pieces: ...
0
votes
1answer
154 views

How to rotate CharacterController on slope

I'm trying to rotate my characterController player on a slope on the 'x' and 'z' axises, however things aren't going so well. The player does rotate, but if I move and look in another direction, the ...
0
votes
1answer
66 views

Handedness of 2D coordinate systems

I know that there's always a big debate on the handedness of 3D coordinate systems, but I can't seem to find any information about the handedness of 2D coordinate systems. Usually, the X axis points ...
0
votes
1answer
176 views

Unity3D: Replicating SM64 turning movement into Unity

Brief Summary: I want to recreate Super Mario 64 turning movement into unity without the clunky movement I currently have. And I would also love how to implement the camera rotation system mentioned ...
0
votes
1answer
92 views

how to get if a rotation/position has been completed?

I've done an if / else with the final position / rotation plus they never complete, how can I check this? stays like this https://i.imgur.com/3cQ9AEk.gif ...
0
votes
3answers
74 views

In 2D, how can I improve character rotation using raycasts when dealing with sharp/convex edges?

Edit: After making some edits to my polygon collider (based on @Alex F's suggestion), I can indeed confirm that sharp, convex corners are causing the buggy ...
0
votes
0answers
31 views

How to convert a rotation around an axis into pitch and yaw rotation

So i want to rotate particles towards a point and i've already figured out how to calculate the angle and the rotation axis. Currently what i do is simply use a 3 dimensional matrix, apply the ...
0
votes
0answers
20 views

how do I instantiate something with only the y axis rotation matching the instanciators y rotation

i'm making a swimming mechanic for my game and i need to instantiate the swim camera under neath the fps player when it hist the water. no mater what I try the swim cam wont have the same y rotation ...
0
votes
1answer
49 views

how do I move an object based on rotation of another object?

This question is related to my other question about camera rotation. I hope its acceptable to ask a second question. I cannot figure out the math of how to calculate moving the camera to stay behind ...
3
votes
1answer
93 views

Why does my collider rotate correctly on a slope only when a ray is cast directly from its center?

Edit: This answer might also be helpful to those who come across this question. I've been messing around with raycast collisions and slopes, but am having an issue when trying to get my collider to ...
0
votes
2answers
67 views

RigidBody.MoveRotation Resetting to (0,0,0);

I'm trying to rotate a character on along the y axis but rather than continuing to rotate, it rotates then the y rotation goes back to 0. I'm not sure what I'm doing wrong. The same thing happens if I ...