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

learn more… | top users | synonyms

0
votes
1answer
30 views

FPS horizontal smooth camera rotation

I have a problem, my camera is parented to the FPS Controller prefab, then there is a script I wrote for the rotation of the player horizontally by mouse movement, it all works but the rotation is ...
0
votes
0answers
25 views

Rotation matrix is being inconsistent with pitch and roll

I'm calculating the rotation matrix for a turret when it's at an angle in Javascript. I have XYZ co-ords for the turret and target with X being 90 degrees right, Y being straight ahead and Z being ...
0
votes
1answer
20 views

Rotating the view around the origin of the world coordinate system

In OpenGL (using shaders), I want to implement a system that will take the user's mouse as input, and then rotate the view about the origin of the rendered scene. So, I need to compute the view matrix ...
2
votes
2answers
125 views

Make camera follow and rotate with player without childing it

I want to have a camera, that follow the player, without childing it to the player object. So far I have this one line, that follows the player, but does not rotate with it (meaning the camera should ...
1
vote
2answers
72 views

How to make sprite move in any direction?

I have an arrow sprite that rotates based on where my cursor is pointed, I can only make it move up,down,left and right.How about in a diagonal way? //this is the rotation nt x=Gdx.input.getX(); ...
1
vote
2answers
50 views

Unity 3D - Confine a gun rotation within certain degrees

I am having troubles making my gun rotate up and down, and have limits, for example, I want the down limit to be 0 degrees, and the up limit to be 90 degrees. Currently I can't figure out how to ...
0
votes
1answer
39 views

Rotation in 3D space using Quaternion

System Configuration I have two simulation systems (which I am going to call Sim-A and Sim-B) where I am going to spawn an entity created in Sim-A inside Sim-B. Expected outcome The entity created ...
2
votes
3answers
50 views

Unity - Check if object is facing Vector3 coordinates

I am having a hard time figuring this out, I want to have objects that move around randomly, and when they get new coordinates to move towards, face them, and then move. Here's explained: Target ...
1
vote
3answers
30 views

How to rotate a whole rectangle by an arbitrary angle around the origin using a transformation matrix?

Suppose, I have a rectangle ABCD. Where, A(0,0), B(7,0), C(7,5) and D(0,5). I want to rotate the whole rectangle by theta = 50°. I know that, a rotation transformation matrix can be used to do ...
-2
votes
1answer
30 views

Which of these two rotation methods are better

Since I've been game devving the method of rotation ive employed has been this: setOrigin(screenWidth/2, screenHeight/2) theta = getTheta() // Cycles through 0 - 360 in radians cP = vec2(0, 0) ...
0
votes
0answers
42 views

Object Rotation with mouse around his axis using Quaternions

I faced a couple of days ago a gimball lock problem , trying to rotate an object on openGL 2.1. I have done some researches and found out that Quaternions could help me. So I implemented the class ...
2
votes
0answers
81 views

OpenGL 2.1 rotation , Gimball lock

I'm working on a little app for a school project , which should be manipulating 3D objects. And i'm stuck with the rotation , as i'm facing what i think is called the gimball lock ? here's a video I ...
2
votes
1answer
40 views

How to calculate if a point is contained in rectangular camera viewport with rotation?

I am working with my camera, and am trying to improve it so that I can calculate if a world point is on screen, taking rotation into account. Currently, my camera rectangle is calculated as so: ...
1
vote
2answers
43 views

Acceleration and Deceleration During Rotation

I'm attempting to have a sprite rotate in a way where its rotation speed increases until it has reached the halfway point in its rotation, to which it starts to slow down. I'm currently calculating ...
1
vote
0answers
27 views

How to calculate a quaternion rotation between 2 vectors with a specific final up vector?

I know you can calculate the quaternion rotation between 2 vectors with something like this after all the optimizations: quat quat::fromtwovectors(vec3 u, vec3 v) { vec3 w = cross(u, v); ...
0
votes
2answers
71 views

Player rotation issues (Player returns to default forward rotation after releasing keys)

So basically what is happening is that my player rotates and faces the direction that he is currently being steered toward (which is wonderful). But after I release, let's say the A key, meaning he is ...
1
vote
1answer
46 views

Why is the camera tilting around the z axis when I only specified x and y?

My goal is to program a camera to point towards the mouse cursor. I attached the following script to the Main Camera. using UnityEngine; using System.Collections; public class CameraController : ...
1
vote
1answer
39 views

Rotation before scaling image/Lower resolution rotation? (XNA/C#)

Currently, when I rotate the image using SpriteBatch.Draw() the image is rotated after it is scaled. Resulting in: Which is using the code public override void Draw(GameTime gameTime) { ...
1
vote
0answers
42 views

Hinge joint annoying wheels rotation in Unity

I try to made a little skate game prototype in Unity 5 and I just encountered an issue. I added a hinge joint between the board and each of the wheels couples (front and behind) so the board can move ...
2
votes
1answer
74 views

Problem with Rotation - C#/XNA

I have a projecile(Hook) and the tail of the projectile(yellow balls) TailProjectile class draws a ball at the exact position of the projectile(hook) and let it there until the projectile ends I'd ...
0
votes
1answer
34 views

How can I modify the UV co-ordinates on a texture so they converge to a point?

I'm building a roof visualiser app, where someone can take a picture of their roof, define its outline, then visualise a new roof texture on it. I'm generating a 3D plane that matches the roof ...
0
votes
0answers
27 views

Libgdx polygon ratating

I'm using polygons for collision detection. Here is the code: poly = new Polygon(verticies); poly.setOrigin(100,100); poly.setRotation(45); renderer.setColor(Color.GREEN); ...
1
vote
0answers
9 views

CanDraw in large hierarchical scene with rotation

I've been assigned to write small simulation visualization, that contains thousands of cubes (I know you heard that before). Now I'm working on optimization of stuff that takes place there, but ...
0
votes
1answer
36 views

Would Raycast suffice for a game clock based on sun position?

I need help with some logic in my script. I created a dynamic day/night cycle that works fine in itself, but I want to add a game clock that works off the initial position of the sun (Directional ...
2
votes
1answer
43 views

Separate rotation transform from parent

I have a hierarchy like this Body - Head - Arms Currently this works fine in that the Body's transformation is reacting as it should. Being children, the Head and Arms match the Body's ...
6
votes
1answer
83 views

How can I keep the clicked point under the mouse when rotating? (GLM)

I have a spherical mesh of radius 1, centered at (0,0,0) in world coordinates. I want to rotate the sphere so that the clicked point remains under the mouse at all times. However, I cannot find an ...
0
votes
0answers
43 views

I have a script that changes an object to a broken version of itself when clicked, but it keeps rotating the object

So I have made a script in unity that you put on an object and when you click the object it will delete the object and replace it with a broken one I made in blender. My problem is that when I click ...
2
votes
1answer
84 views

How to rotate an object along its trajectory path?

I have a missile launcher that uses initial velocity for the trajectory. I edit the launch angle from the editor, and then the script calculates the initial velocity required to land the missile to ...
0
votes
1answer
46 views

Rotation with respect to world instead of the object itself using Quaternion.Euler in unity

[Other answers on similar questions on stackexchange didnt help] This script is giving some weird outputs On running this script If I press rightarrow once followed by 's' the object rotates on 'z' ...
0
votes
2answers
310 views

Rotate an object smoothly by 90 degrees on key press in unity3D

[I saw few similar question on stackexchange but none is solving the purpose.] I want to rotate a 3D object by 90 degrees on different axis on respective inputs. For example if 'a' is pressed, the ...
0
votes
2answers
79 views

XNA Rotating a Rectangle?

I am in the process of making a giant shooter game and I have got to the point where I needed to use rectangles to detect bullets and giants hitting the player. I did that however, if you look at this ...
0
votes
1answer
46 views

glRotatef not rotating simple 2D triangle

I am new to OpenGL and am learning it for the purpose of some simulation that I am doing as part of my research work. I have been following the tutorials given at ...
2
votes
1answer
65 views

Increment grid by rotation

I'm currently working on a grid for snapping objects side by side. My current script is working fine, but only for game objects which haven't been rotated. Here is an example video of the problem: ...
0
votes
1answer
61 views

Free camera rotation in 3D space

I'm using a view matrix to do camera movement and rotation. viewMatrix = new Matrix4f(); viewMatrix.setIdentity(); Matrix4f.rotate((float) Math.toRadians(rx), new Vector3f(1,0,0), viewMatrix, ...
0
votes
1answer
70 views

LibGDX make an object rotate around something

I need to rotate and object, which should be a circle made up with a ShaderRender, around a specified point. In LibGDX there is a method or something which allow me to do this? If it doesn't exist how ...
3
votes
2answers
103 views

How do I calculate rotational impulses in rigid body collisions?

I'm writing a simple 2D physics engine to help me understand the inner workings of physics engines. I'm following Randy Gaul's tutorial which can be found here and It's been extremely useful and ...
2
votes
1answer
71 views

In XNA, how do I access a model's dimensions with code?

I'm trying to rotate a model around some axes, but this rotates it around the world origin. I understand that I need to translate the object relative to its own size before rotating it, but I don't ...
1
vote
1answer
130 views

unity3d - Instantiate and fire bullet realtive to player rotation in 3D

This is a top-down view but in 3D coordinates, I would like to instantiate and fire a bullet from the player's gun. This script is on a spawner object at the end of the barrel. Also tried putting the ...
1
vote
1answer
74 views

Turn the front wheels of a car according to the car's bezier path

I have a 3D car which follows a predefined 3D Bezier path. I want the car's front wheels' rotation to match the car's changing direction. I had the idea to match the wheel's orientation to the ...
0
votes
2answers
82 views

Position child on the edge of the parent circle while scaling unity3d

I have come across to some different situation. I have one circle sprite and i am rotating circle continuously while rotating i want to make circle smaller and larger. I have one object on the edge ...
0
votes
1answer
92 views

How do I rotate a cube around an axis, relative to the camera view?

I want to be able to rotate a cube, either by dragging vertically to rotate it around the Y-axis, or dragging horizontally to rotate it around the X-axis. However, when the camera is rotated 90 ...
0
votes
1answer
135 views

Unity forward vector flips when upside down. Mario Galaxy style gravity, bad rotation?

This is a question that I think is best to explain visually, so I will do my best to be succinct here. What I am trying to do: Allow the player to run about a world that is spherical, not a flat ...
0
votes
1answer
82 views

Calculate 3D “up” vector to align ship to an arbitrary axis

I'm writing a script to control the movement of a 3D ship in a game. Given the ship's position and the coordinates of the destination, I've successfully calculated the Yaw and Pitch necessary to aim ...
0
votes
0answers
32 views

Rotate the camera on a given angle

Good day! I apologize in advance for my bad english. The task is as follows: "On the stage there is a camera and a gun with rays when a ray gun out of sight of the camera (vertical) is required to ...
2
votes
2answers
147 views

How do I rotate and object around itself, and translate it at the same time?

I have this animated gif of my problem. I have a sprite object with a box collider, and I'm trying to rotate it around its center. My rotation script consists of this : this.transform.Rotate (0, 0, ...
0
votes
1answer
78 views

How to create a smooth rotation with a constant angle?

I am trying to make a game where the player can only rotate to 4 angles. Something like this I cannot use Quaternion.Rotatetowards because the player's position is not constant, but I don't have the ...
0
votes
1answer
121 views

How to modify the Unity sprite renderer (or create a custom one) that can display the sprites on the X-Z plane?

Prefix: I am NOT trying to rotate a sprite 90 degrees by it's transform, this changes what is up/down and forward/backwards for the object. I need the sprite displayed on the X-Z plane in comparison ...
1
vote
1answer
80 views

Determine which face of a cube is facing the camera

I have a Cube with a unique color for each face. I made a script where I can swipe and rotate the Cube in increments of 90 degrees in each direction. what's the best way to determine which face of a ...
0
votes
2answers
82 views

Problems with Rotation Matrices on Certain Axes

Here is what my rotation matrix looks like: public Matrix4f initRotation(float x, float y, float z) { Matrix4f rx = new Matrix4f(); Matrix4f ry = new Matrix4f(); Matrix4f rz = new ...
1
vote
1answer
64 views

Why is rotation not applied instantly?

I am working though the Space Shoot tutorial and I have just applied tilt to the player object. One of the things that I have noticed is that the tilt is not applied instantly but instead the player ...