Skip to main content

Questions tagged [orientation]

The directional facing of an entity in the game space.

Filter by
Sorted by
Tagged with
0 votes
1 answer
37 views

How to correctly position a set of cuboids based on a direction property in MonoGame

I am trying to create a map for my game using a list of cuboid sections that are defined like this: ...
Maxim Gershkovich's user avatar
0 votes
1 answer
231 views

Finding the center of rotation in 3d knowing the start/end transformations

I need your help to solve a trigonometry problem, I'm unable to find any documentation about on the web... For convenience, I will use "transform" to indicate a position+orientation. Let's ...
lightimpact90's user avatar
-1 votes
1 answer
299 views

Does Screen.orientation not work in simulator?

I use the Screen.orientation property to reposition my UI when the screen is rotated. But when I rotate the simulator to left or right, ...
利维坦's user avatar
1 vote
1 answer
294 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 ...
Tyranna's user avatar
  • 11
1 vote
0 answers
2k views

Orientation changed event in Unity3D?

I'd like to listen to orientation change events, so for example my UI layout or the components themselves can be changed. All I've found is that I should check the value of ...
Tudvari's user avatar
  • 761
0 votes
0 answers
29 views

Efficient way to compare vectorial direction?

I have a bunch of random vectors representing a direction and four other vectors that we can distinguish with their pyramidal arrows at their extremity, they represent a boundary what i'd like to do ...
DB3D's user avatar
  • 103
0 votes
1 answer
65 views

How to re-calculate orientation vectors when one of them is being changed?

I want to implement a Unity-like API for my transforms, with the ability to set forward, right, up vectors directly and change object's rotation quaternion accordingly. I got stuck at the math behind ...
IC_'s user avatar
  • 163
0 votes
0 answers
1k 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 ...
poojiiee's user avatar
1 vote
1 answer
3k views

Unity Gyroscope orientation (attitude) "wrong"

I am using the Unity reference and example implementation here https://docs.unity3d.com/ScriptReference/Gyroscope.html I struggle to fix an orientation problem. When my phone lies flat on the ground, ...
TheCell's user avatar
  • 93
0 votes
0 answers
62 views

Orientation is off when nearing 90 degrees rotation

Context: I am using Vive Trackers to track the head of a user. It is not a Vive headset and I am restricted to the TrackingUniverseRawAndUncalibrated, which only guarantees that the Y axis will be UP. ...
Alex Millette's user avatar
3 votes
1 answer
1k views

Unity - X axis back to front

I'm using Unity 2018 and its really confusing me. I generate a plane mesh in code and when it comes to positioning (transform.position.x) it on the X axis I can't understand why moving it further to ...
Bananas's user avatar
  • 31
1 vote
1 answer
787 views

How to align 2 IMUs' quaternions?

Suppose I have 2 IMUs that output 2 quaternions. I place one IMU on my left hand and another one on my right hand. I put both my hands flat on the table and point it forward to the same direction. ...
offchan's user avatar
  • 125
2 votes
1 answer
373 views

Aligning rotation from a imu9250 to a game object

I am experimenting with interfacing unity with real world inputs, specifically I have an imu9250, connected to an arduino clone providing rotation inputs ( either quaternion or pitch/yaw/roll) to ...
user3150497's user avatar
0 votes
1 answer
181 views

How to Work With Arbitrarily Oriented Vectors

I'm brushing up for a pending game jam and just for kicks I thought I'd let the gravity in my 2D platformer push at an arbitrary angle. Normally gravity points downward (3 PI / 2), but if I wanted it ...
Hammer Bro.'s user avatar
0 votes
1 answer
31 views

How to orient a layer to connect 2 points AND facing the camera

here is my question, which I hope will be in general interest: If you have got 2 Points in 3D space and want a plane to connect those, you can quite easily use a function similar to "lookAt" to ...
ayma's user avatar
  • 3
2 votes
1 answer
1k views

How to smooth rotations?

I have a semi-regularly (15fps to 60fps) sampled source of position and orientation to which I am using dead reckoning to fill in gaps. However, I would like to smooth it further to eliminate any ...
JeffV's user avatar
  • 185
1 vote
0 answers
836 views

SceneKit-Convert a rotation vector into rotation matrix

I'm very new and I'm studying this ARKit code from RPasecky/CubesInSpace on github where he/she convert the point of view 's rotation vector into a rotation matrix ...
Motoko's user avatar
  • 111
1 vote
0 answers
27 views

iOS 8 iPad Mini Orientation thinks It should be landscape despite it being disabled

I've only enabled portrait mode in the info.plist and generally the iPad Mini running my game works fine except if I quickly change its physical orientation from landscape to portrait, the app ...
meds's user avatar
  • 1,480
1 vote
0 answers
216 views

Using orientation sensor data for Android game

I'm building a game where a green box floats to different parts of the screen. The user must rotate their phone such that the blue dot intersects the green square. This is different from a standard "...
aaa's user avatar
  • 111
1 vote
0 answers
36 views

Transform arbitrary axes to world axes

I'm in the case I need to transform a Quaternion coordinate system to a concrete one, let me explain. I'm implementing an orientation tracker for VR headsets, I have the orientation of the device and ...
Gusman's user avatar
  • 259
0 votes
1 answer
869 views

Gamemaker display orientation detection

I am making a game that needs to detect when the device gets turned over in landscape mode to landscape-flipped to change some game mechanics when the player does so. The project is already set to ...
PayToPwn's user avatar
  • 123
1 vote
4 answers
1k views

How can I min-max quaternions?

What I'm doing In my engine, I'm trying to implement a camera that will follow a target object, such as a player. I wanted to avoid just simply using the inverse of the target's transformation, ...
Yattabyte's user avatar
  • 1,033
0 votes
1 answer
115 views

Google Games Services Display Orientation

I'm developing a game using LibGDX and I'm using BaseGameUtils to implement Play Games Services in it. It's working very well. But my game is in landscape mode, so ...
Neerkoli's user avatar
  • 479
1 vote
1 answer
5k views

Finding relative x and y value on a sprite [Gamemaker]

I'm having a little conundrum that may just result from a lack of knowledge of Gamemaker's functionality. I've attached two images to aid explanation. I have a sprite of a turret (with a gun barrel), ...
Bonfire Dog's user avatar
2 votes
0 answers
449 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: ...
user68412's user avatar
1 vote
1 answer
147 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 ...
Bill Kotsias's user avatar
1 vote
1 answer
123 views

Vector magnitude in orientation

First, a quick overview of my problem: I have a game entity which has a quaternion to represent its rotation/orientation. It also has a 3D vector in world space for its linear velocity. From the ...
Intrepid Encephalon's user avatar
1 vote
1 answer
76 views

Torch fire always up regardless of handle direction

I have a prefab from some asset pulled into our project. It is a simple torch.. handle and a particle system for the fire. Works perfect if mounted on a wall and torch angle adjusted no problem. ...
DRapp's user avatar
  • 135
5 votes
1 answer
3k views

Unity Android Orientation Bug in Auto Rotate

I am currently looking for a workaround, or fix, for a Unity bug. I want to be able to auto-rotate my game, while respecting the Android system settings. Currently, if you set your Unity Orientation ...
jgallant's user avatar
  • 8,424
3 votes
2 answers
5k views

How to calculate left/right oriented angle between two 2D vectors? [duplicate]

I would like to calculate angle between two 2D vectors. Here's a picture of what I'm trying to achieve: I have an obstacle line segment AB and incoming moving PC. If I'm coming from one side C¹D¹ and ...
SmartK8's user avatar
  • 614
1 vote
3 answers
2k views

How do I fix my planet-facing camera?

Summary I'm having trouble implementing a camera controller suitable for first person use around a planet. The camera needs to be oriented correctly according to gravity (vector from camera ...
moldyviolinist's user avatar
3 votes
3 answers
6k views

How can I reorient the axes of an object?

I spent some time in Unity yesterday trying to fire a sphere from a horizontal cylinder (like a ball from a cannon). I was using Vector3.forward, but the sphere kept coming out the top of the cylinder ...
lofidevops's user avatar
0 votes
1 answer
243 views

How can I support both multiple resolutions and multiple orientations in a game?

I am writing a mobile Android and iOS game. This game is similar to Doodle Jump, but without scrolling. In my game I display a background image that should cover the entire screen. On top of that I ...
erebel55's user avatar
  • 343
0 votes
1 answer
991 views

Relative Position/Rotation calculation

I have 2 objects each with a 3x3 Matrix (Orientation) and a Vector3 (Translation). Both are relative to world coordinates. How do I calculate the position and orientation of object B in relation to ...
user43230's user avatar
1 vote
1 answer
2k views

Change game from portrait to landscape dynamically

I have multiple classes that implement Screen. I want to, say, have the Main Menu screen portrait, then the Play Screen ...
user959631's user avatar
3 votes
1 answer
135 views

Finding the monitors orientation in XNA for Windows

Just to be clear this is not for Windows Phone 7. =) I've got some interesting requirements for a project and I'm having trouble trying to find the information I need. I have two monitors. The ...
lose_the_grimm's user avatar
3 votes
1 answer
438 views

How to map absolute Joystick position to object rotation?

In my (Ogre) 3d scene I have an object that should be rotated locally based on Joystick input. I have a Joystick with min/max values of [-32767, 32767] on both X and Y axes. When the Joystick is in ...
Matthias's user avatar
  • 717
3 votes
1 answer
656 views

How do I determine a device's default orientation?

I am developing a game with accelerometer controls. This works well on all the mobile phones I've tested it on. However, when testing on a tablet, the y and x axes are reversed, presumably because the ...
Rhys's user avatar
  • 273
6 votes
1 answer
4k views

Quaternion Look At with Up vector

I have implemented a "look at" method for my screen elements and it almost works how I want it to work. The ScreenElement class uses a R3 Vector and a Quaternion to determine the position and ...
rioki's user avatar
  • 2,866
29 votes
5 answers
21k views

Why is Y up in many Games?

I learned at school that the z-axis is up. It is the same in modeling software like Blender. However in many games the y-axis is up. What is the reason?
danijar's user avatar
  • 5,741
3 votes
2 answers
9k views

convert orientation vec3 to a rotation matrix

I've got a normalized vec3 that represents an orientation. Each frame of animation, an object's orientation changes slightly, so I add a delta vector to the orientation vector and then normalize to ...
lapin's user avatar
  • 229
13 votes
2 answers
12k views

How is the gimbal locked problem solved using accumulative matrix transformations

I am reading the online "Learning Modern 3D Graphics Programming" book by Jason L. McKesson As of now, I am up to the gimbal lock problem and how to solve it using quaternions. However right here, ...
Luke San Antonio Bialecki's user avatar
3 votes
1 answer
265 views

How to make an object stay relative to another object

In the following example there is a guy and a boat. They have both a position, orientation and velocity. The guy is standing on the shore and would like to board. He changes his position so he is now ...
Nick's user avatar
  • 1,605
3 votes
0 answers
561 views

Setting Orientation of Character in Bullet/Ogre [closed]

I've been suffering from an issue regarding the implementation of orienting characters in a game I'm implementing using Ogre3D and Bullet physics. What I have: A Direction Vector that the character ...
clamped's user avatar
  • 139
3 votes
1 answer
564 views

How can I use orientation to compute position in Windows Phone 7? [closed]

I'm using the motion API and I'm trying to figure out a control scheme for the game I'm currently developing. What I'm trying to achive is for an orienation of the device to correlate directly to a ...
Daniel Little's user avatar
16 votes
4 answers
14k views

X, Y, Z coordinate standards?

I'm pretty new to 3D development of any kind, nonetheless games. As I read through tutorials and examples, I find that the X/Y/Z coordinates seem a bit backwards than my first guess. I had imagined ...
Corey Ogburn's user avatar
  • 1,135
9 votes
1 answer
3k views

Rotate object to face player

This is probably a simple vector question, but I'm not sure how to do it. I have an object at vector position (ox,oy). Potentially every update, the user walks ...
XSL's user avatar
  • 545
3 votes
1 answer
257 views

Follow point of interest by applying torque

Given a body with an orientation angle and a point of interest or targetAngle, is there an elegant solution for keeping the <...
azymm's user avatar
  • 131
9 votes
1 answer
991 views

Changing orientation by applying torques

Suppose you've got an object floating freely in space. You have a vector you want this object to point towards, and a vector representing the direction it's currently facing. From these two, you can ...
Karantza's user avatar
  • 452