Rotation is the circular movement of an object around a specific axis.
1
vote
1answer
48 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
56 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
36 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
41 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 ...
-1
votes
0answers
41 views
Rotation problem with Quaternion.Euler in unity [closed]
void Rotate()
{
Vector3 lastDirectionInGlobal = _camera.ScreenPointToRay(rightFingerLastPoint).direction;
Vector3 currentDirectionInGlobal = ...
0
votes
1answer
63 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
0answers
25 views
swap rotation problem in mobile game (unity) [closed]
using UnityEngine;
using System.Collections;
[RequireComponent (typeof (CharacterController))]
public class Camera_rotation_onSwap : MonoBehaviour {
public bool kJoystikEnabled = true;
public float ...
0
votes
1answer
46 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
26 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
85 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
46 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
34 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
55 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
46 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
53 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 ...
2
votes
2answers
74 views
How do I keep my orbiting camera upright?
I am working on code that rotates the camera around a point on the in-game map when dragging the mouse. I understand how to lock it so it stays above the map surface.
However, if I keep rotating the ...
0
votes
1answer
104 views
Rotate Object Towards Direction in 2D
For my RTS game's physics engine, I'm trying to find out a clever way to make a unit face the direction it's moving in. Given a Vector2d direction of movement (its normalized velocity), how can I ...
0
votes
2answers
83 views
How to rotate (YAW) aircraft in XNA?
I'm developing a flight simulator based on Riemer's Blog tutorial (XNA C#). To control the aircraft, I use the following code:
Quaternion additionalRotation = Quaternion.Identity;
additionalRotation ...
4
votes
1answer
111 views
What direction is forward when the rotation is (0, 0, 0)?
I'm representing the rotations of my actors (or gameobjects) with euler angles (one float for each axis). And I've always considered the vector (1,0,0) (x,y,z) to be the actor's direction if all ...
0
votes
0answers
37 views
Java Slick2D rotating a Shape using transform(Transform.createRotateTransform())
I have spent most of the day trying to debug this tiny piece of code, and I can't for the life of me figure it out.
I'm making a pong game for the Mini Ludum Dare currently going on.
I am programming ...
0
votes
2answers
92 views
How to stop rotation every 90 degrees?
I was facing another rotation problem yesterday, that i managed to solve by rotating the object like this :
transform.Rotate (speed * Time.deltaTime, 0, 0, Space.World);
I tried almost every other ...
0
votes
1answer
42 views
How can I rotate a Transform over a specified time in a single line of code? [duplicate]
How can I rotate a Transform over a specified time in a single line of code?
I have had a lot of trouble with this in the past. I wrote a script which rotates a Transform by a specified rotation ...
0
votes
0answers
18 views
Bike rotation freeze rotation
Hello im making a bike game and need it to stay up (doing a wheelie) without gravity knocking it down ive tryed freezing the rotations and turning off gravity and it dosent work, so not sure how to do ...
0
votes
0answers
16 views
2D smooth Rotation Unexpected
I am trying to get a smooth 2D rotation and this semi works but only in (-x, +y) I have tried using a lerp but I still get the same result.
So I believe, it has something to do with the rot_z value ...
0
votes
2answers
35 views
Combining two independent rotations relative to the world frame
I am implementing a mouse rotation which works by accumulating the X-Y delta between frames to yaw and pitch rotation angles. The problem is that I wish rotations to be independent of each other. But ...
1
vote
0answers
79 views
How do I implement realistic recovery from weapon recoil?
I want to create an equation determining how fast a gun recovers back to its center after it has fired. I have a weapon system functioning based on constants (recoil amount, bullet spread, etc.) ...
0
votes
3answers
79 views
How to rotate a gameobject to the specific angle
I have tree model that is being rotating .After certain angle it should stop rotating.I have done a sample code.But the tree is not stopping.
void Update () {
//transform.Rotate ...
5
votes
2answers
268 views
How does glRotate affect the axes of the global coordinate system?
I am currently playing around with 3D transformations applied on a 2D context in LWJGL, to later be implemented in my game. So I managed to set up LWJGL well enough (scaling, translating, scaling and ...
0
votes
1answer
38 views
Matrix Rotation Only Works On one Axis At A Time
I have this function in my vertex shader. It makes a transformation matix out of a transformation matrix, a rotation and an intensity. It works just fine when setting the rotation of one of the axis ...
11
votes
3answers
291 views
Rotate object around fixed axis
I am trying to let the user of my app rotate a 3D object drawn in the center of the screen by dragging their finger on screen. A horizontal movement on screen means rotation around a fixed Y axis, and ...
0
votes
2answers
50 views
Gradual rotation of an object in Java
I'm using Java to learn some movement algorithm. I would like to implement the "wandering" algorithm, but in order to do it, i should understand how to rotate an Object gradually.
Actually, my Player ...
0
votes
0answers
14 views
How can I track a leader vehicle at a specific angle and distance?
I am using Matlab and have code which allows a vehicle to find its way to certain coordinates chosen by the user. I now want to add a second vehicle which stays fixed at a specific distance and angle ...
0
votes
2answers
99 views
Vector3.Angle() Never Reaching 0
I'm having trouble understanding why with this script, Vector3.Angle() sometimes will never reach 0.
This question comes from me trying to make a "turret" that rotates to face a target position. It ...
0
votes
0answers
54 views
Pre- or post-multiplication for rotation between coordinate frames
I have three 3D coordinate frames: O, A and B, as shown below.
I want to know the rotation matrix RAB between A and B, that is the rotation that is required, with respect to the frame A, to move ...
0
votes
0answers
26 views
Rotating between two coordinate frames
I have two coordinate frames, A and B. I want to create the rotation matrix RAB which takes you from A to B. A is a right-handed system, and B is a left-handed system. Furthermore, after moving from a ...
0
votes
1answer
63 views
Rotate a plane defined by its normal and its distance
First apologies for the amount of pictures, it's a bit hard trying to explain my problem without pictures. Hope I've provided all the relevant code. If you feel you want to know about how I am doing ...
1
vote
0answers
52 views
Unintended twisting of geometry while generating a mesh?
I am creating a real time animation of tori (toruses), and I've run into a problem where at certain angles of my tori, the geometry is twisting up where it should remain straight.
Here is an animated ...
-1
votes
2answers
107 views
Accelerometer bike game rotation help
Hi I've been making a game for the last few months and not sure what to do.
It's a 2d bike game and I want the rotation done with accelerometer, at the moment To test on computer I've set the ...
0
votes
0answers
29 views
Quaternion Slerp Over Time Help
I've gathered some code from several places and the final result almost works correctly. However, at times there is noticeable "snapping" from one place in the rotation towards the finish or too ...
0
votes
1answer
54 views
Fps independent rotation [duplicate]
I'm trying in my game to have camera rotation speed idependent of fps. For keyboard it works without problems but not for mouse movoment. At 60 fps it works good but at 200 for example rotation is to ...
0
votes
0answers
38 views
Motion Blur (as per GPU gems article) only considers camera rotation, not translation
I am following this article and have implemented it exactly as described:
http://http.developer.nvidia.com/GPUGems3/gpugems3_ch27.html
The problem is that things are only blurred when the camera is ...
0
votes
2answers
80 views
Rotating an object with quaternion
I have a question in regards to using quaternions for the rotation of my graphics object.
I have a Transform class which has the following constructor with default parameters:
Transform(const ...
2
votes
1answer
135 views
Project rotated matrix to isometric coordinate
I have a group of soldiers, and each has a vector describing their position in the squad. When the group rotates, I do this math to calculate the desired position of each soldier.
var unitPositions : ...
0
votes
1answer
59 views
Affine transformation: rotate a plane parallel to another plane
I am writing a function that extrudes a 2D shape along a 3D spline, as found in 3D modeling software.
I need a way of translating a set of points P so that they all lie in a new plane L (preserving ...
1
vote
0answers
38 views
Is there a way to rotate an Ellipse in libGDX for collision detection purposes?
I'm trying to avoid having multiple overlapping Circles for a UFO-shaped sprite.
Two Ellipse objects will perfectly cover the shape of my UFO, but I want to tilt/rotate the UFO when flying left and ...
2
votes
2answers
91 views
Translating an object in the rotation direction
I am creating a graphical scene with OpenGL and SDL, and I'm running into a problem in regards to translating an object in its rotation direction.
Each of the graphical objects in the scene has a ...
0
votes
0answers
97 views
Minecraft Forge 1.7.10 Modding: Using BlockPistonBase metadata as a determinant for facing direction
I've recently begun to revamp some old code that I've had lying around by utilizing a lot of what Minecraft already has available, but have run into a bit of an issue. I have this large chunk of code ...
0
votes
0answers
19 views
Java JBullet rotating rendered rigidbodies
Hello I wan't to rotate object I wrote some piece of code but that don't won't to work. Here is this code:
glPushMatrix();
float[] matrix = new float[16];
...
0
votes
1answer
31 views
How to compute the forward facing direction from three angles and then translate along it?
Given:
float yaw, pitch, roll;
How does one compute the forward direction:
vec3 forward = computeForwardFromEulers(yaw, pitch, roll);
Next, I would like to use this information to translate an ...
0
votes
0answers
60 views
Transformation order for augmented reality game using OpenCV and OpenGL
I'm trying to create a simple AR application where I'm augmenting the camera image of a Kinect with virtual objects that are tracked using an optical tracking system.
The following picture ...