Questions tagged [rotation]
A rotation is a circular movement of an object around a center (or point) of rotation. On a mobile device, it indicates the change of orientation.
12,026
questions
0
votes
1
answer
31
views
python: rotate an array 90 degree - but not symetric dimension
I am implementing a game which uses blocks, that contain of pixels.
I want to be able to rotate those blocks.
Therefore I began to use this nice line:
self.array = zip(*self.array[::-1])
But as it ...
0
votes
0
answers
12
views
ThreeJs: How to rotate an already animated object
I have created an object (spaceship) in Blender, animated its movements (make it wobble/rotate a bit randomly) and exported the 3D model to ThreeJs.
If the user presses LEFT ARROW, the model should ...
0
votes
0
answers
31
views
Scene Kit Rotation - rotating around X and Y axis only, causing Z rotation
I am trying to control the orientation of a box in Scene Kit (iOS) using gestures. I am using the translation in x and y to update the x and y rotation of the SCNNode.
After a long search I have ...
0
votes
0
answers
9
views
Upper and lower body rotation issue in Unity
I've got a problem related to rotation that's driving me crazy.
I'm pretty new in the 3D world and I'm playing with character movement. The goal is to:
Have the upper body face the player's looking ...
0
votes
2
answers
34
views
I am working an a player script for a 1st person game, can anyone help me add clamping to this rotation script?
cameraVertical = Input.GetAxis("Camera Vertical") * turnSpeed * Time.deltaTime;
myCamera.transform.localRotation *= Quaternion.Euler(cameraVertical, 0, 0);
I am working in unity, and I am ...
0
votes
3
answers
65
views
How to constrain a rotated View/Button to the left side of ConstraintLayout on Android?
Edit: it is possible to just to use translateX (see comments and accepted answer). I don't know how I missed that.
On Android, I want to rotate a simple button 90 degrees and have it stick against the ...
0
votes
2
answers
34
views
PySide6/PyQt6 movable QGraphicsTextItem malfunction when changing it's angle - spiraling around cursor when QGraphicsTextItem angle is above 60
I want to create a GUI application that is able to put watermark on a photo and save it - I want to be able to move this watermark by pressing, holding and moving around the cursor, I also need to be ...
0
votes
1
answer
29
views
Rotate dataset in specific order using python
Using Iris dataset as an example I am interested in sorting by species order (so that it comes as 1,2,3,1,2,3...) then by descending order of petal length as illustrated in expected output.
% dist ...
0
votes
0
answers
20
views
Min number of dice rotation
Hello i'm coding codewars challenge and stuck. There's question :
You are given an array of 6-faced dice. Each die is represented by its
face up.
Calculate the minimum number of rotations needed to ...
-2
votes
0
answers
29
views
How do I make this Text surface rotate around its center? [duplicate]
I am trying to make a test project and want to rotate a Surface containing text in PyGame. However, it distorts the text and the text appears to move from its original position. I have no idea what's ...
-2
votes
0
answers
16
views
Unity 3D Model rotating weirdly, y axis Rotation behavior changing when start to rotate in x axis direction
I am a beginner and i am trying to rotate a 3D model by applying Rotate script that i wrote. The script works well in some scenarios for example when i rotate it from the front its working fine but ...
0
votes
0
answers
18
views
When I use css3 transform scale() and rotate(), there are some weird unknown border line
When I use css3 transform scale() and rotate(), there are some weird unknown border line.
Before add transform:scale() :
After add transform:scale() :
I don't know what's problem here...
This is my ...
-2
votes
1
answer
56
views
3D rotation with wrong rotation axises
i am having a small problem using 3d rotation matrices to implement a rubiks cube simulator. my problem is that, when trying to rotate my cube around the global x and y axis (in 3d), i end up rotating ...
1
vote
1
answer
76
views
Ghostscript: Stop image rotating when converting PDF to Image
I am using Ghostscript 10.02.0 to convert a PDF to a PNG with the following command:
gs -o ./test.png -dNumRenderingThreads=1 -sDEVICE=png16m -r72 -dLastPage=1 -dFitPage -dDEVICEWIDTHPOINTS=125 -...
0
votes
1
answer
49
views
Why is the SVG text not spins in place?
So I have this code:
#ring-svg {
padding: 0;
margin: 0;
width: 100svw;
height: 100svh;
background-color: rgb(35, 35, 35);
}
.alt-font {
font-family: "TnganAlt";
}
#textcircle {
...
0
votes
0
answers
43
views
How does Unity implement its RotateAround function to avoid jitter?
I have a GameObject that I am rotating around a given point in 2D using my own implementation which is the following:
public override IEnumerator transformPlayer(MyTransform target, GameObject ...
0
votes
0
answers
9
views
Quaternion camera stretching object
I've been implementing camera movement using quaternions. Im making a game where you have a plane in front of you and you fly around but when you apply yaw the object just stretches almost infinitely ...
0
votes
0
answers
32
views
Rotating Quadrangle in astropy?
I have been attempting to overplot a Quadrangle on a map that I have to replicate a slit with data on the sky, but I need to rotate the Quadrangle around some center point and have not been able to ...
-1
votes
0
answers
17
views
Is it possible to rotate a group of shapes by any degree? [duplicate]
I'm relatively new to python and I'm doing this pygame assignment for school.
I plan to make an object, an airplane, with a group of ellipses, arcs, and a polygon. Problem is that I need to be able to ...
0
votes
0
answers
15
views
In c99 how do i rotate a face in such a way that the face normal is aligned with a given vector
In c99 i'm developing a small software that deals with faces and vectors, in order to have objects look at a certain direction given by a vector i'm performing the following steps.
I started by ...
-1
votes
1
answer
55
views
Rotate object to face in the direction of movement
I'm working on a simple game where I have a plane in the sky and I am giving it a circular path around some circle with a radius. The plane spawns facing positive z and when moving around this circle ...
0
votes
0
answers
15
views
How to have 3D rotation of a trajectory line in a 2D Game rotate depending on input position
I've had a codementor try and help me figure out how this game is doing this 3d rotation of their trajectory line but we couldn't get it to work yet in Unity.
Game that does the rotation I'm trying to ...
0
votes
1
answer
42
views
Have ButtonImage point to user finger when it is pressed (Kotlin and android studio)
I have a image button that when pressed I want it to point to the users finger (etc. like how a character looks at the users mouse in a video game). however It is not working and it dose not track the ...
0
votes
0
answers
44
views
Camera does not move in direction of camera target
Implementing a simple camera system while learning OpenGL and come across an issue where, when I pitch down or up and move forward the camera goes in the opposite direction of the new camera direction....
0
votes
0
answers
38
views
Getting a different result for when rotating a vector with a euler angles and quaternion
I am trying to rotate a vector in MATLAB in the the following order:
Rotate along x-axis by 30 degrees
Rotate along y-axis by 30 degrees
Rotate along z-axis by 30 degrees
This is my code for Euler ...
0
votes
0
answers
46
views
Equivalent to RotationAngle in order to rotate a label in a TMS Web Core Website?
In FireMonkey, there's a RotationAngle property on most of the visual components. You can use that on a TLabel to rotate it to have the text face different directions such as:
How can this be ...
0
votes
1
answer
24
views
3rd person camera gimble lock
This camera controller does exactly what I need, the only issue is there are limits for rotating beyond looking straight up and straight down. When the camera limits are removed and it rotates beyond ...
0
votes
1
answer
30
views
print when a rotating a box touches a uiview
In my swift code when ball touches border box it should print hit. Right now the ball rotates but nothihing is being printed when it touches borderBox I tried to do something but It is not working and ...
0
votes
1
answer
31
views
Imitating an object's rotation in Godot 4 after they turn 180° in any direction
I am new to Godot 4, I am transferring from Unity. In my game the player controls a spaceship, which is followed by a camera. After getting the input, I update the player's velocity and rotation. ...
0
votes
0
answers
31
views
I need to fix the rotation after uploading photos [duplicate]
I have a problem with my script. I have several photos in a directory, from where the script takes the photos and resizes them to a new directory.
After resizing, I have some photos rotated 90 degrees....
0
votes
0
answers
27
views
12.9 inch iPad Simulator not presenting SpriteNodes correctly for Xcode
12.9 inch iPad Simulator not presenting SpriteNodes correctly for Xcode
When I generate my SKScene, I use
ourScene.scaleMode = .aspectFill
I then display several SKShapeNodes, e.g.,
let roomWidth = ...
0
votes
0
answers
24
views
How can I change touch rotation on Raspberry Pi 3 HDMI without X?
The display rotation (and the dsi touch rotation) is solved by display_rotate=2 in the /boot/config.txt, but the hdmi touch device rotation does not happen.
0
votes
0
answers
75
views
Import and calculate camera orientation into open3d
I am trying to import a mesh generated by Reality Capture (with photogrammetry) as well as the camera positions and their orientation into open3d in python. My goal is to visualize the camera ...
0
votes
2
answers
30
views
rotation_degrees by 90 not always whole number
I decided to learn godot and started with a tetris clone to learn on. Everything is going fine except that every once in a while when I rotate a Node2d object, it doesn't set as a whole number. Then ...
0
votes
0
answers
17
views
segmentation fault in rotating array by D places
In this problem, I am supposed to rotate the array to the left (counter-clockwise) by Dsteps, where D is a positive integer. My code works for small inputs but gives a segmentation fault for larger ...
0
votes
0
answers
54
views
Rotate an object while keeping it dimensions - Matlab
I wish to rotate an object while keeping it dimensions using this code (based on this question: Number of columns/row in mask):
close all;
clear;
clc;
x = 256*rand(1,4);
y = 256*rand(1,4);
x(end+1) ...
0
votes
1
answer
45
views
reverse the rotation of a object
In my swift code func rotate rotates a football. In leftB I want to reverse the rotation of the football. Currently the rotation is going clockwise. If leftB is hit I want the rotation direction to be ...
0
votes
1
answer
73
views
Python 3D rotation of array of vectors, into same frame
I have a (3 column X n row) numpy array of vectors, such that each row of the array corresponds to the components of one of the n vectors in spherical coordinates. The components of each vector are in ...
0
votes
0
answers
39
views
Why is the image rotated incorrectly using the Matrix.rotateM method in Media3 Transformer?
I just want to rotate the image in one plane
I'm trying to mess around with the Media3 Transformer demo https://developer.android.com/guide/topics/media/transformer/demo-application
private ...
2
votes
2
answers
104
views
How adjust content width, height when rotate the block in css
There are many solutions on the Internet, but all of them are either crutches or do not work correctly. Perhaps there is a way to stretch the element in width and adjust the height when rotating more ...
0
votes
0
answers
114
views
How to move curve after rotating it in pyqtgraph
The question is following on a previous question:
Rotate curves in place in pyqtgraph
The curves are rotating now, but I can't move it afterwards, it's jumping back to its previous position before the ...
1
vote
4
answers
70
views
Determining rotation between two points in 2D array
Let's say I have a 4 by 4 maze as shown below, and I've written a program that returns a possible path from start to finish as shown below:
[(3, 1), (3, 0), (2, 0), (3, 0), (3, 1), (3, 2), (2, 2), (2, ...
0
votes
0
answers
64
views
Euler angle of rotation to Axis-angle?
I have a CSV file of Pitch X, Yaw Y, and Roll Z values. I want to convert those XYZ values to axis-angle values (XYZ and Theta). I tried to do the following, but the values I got do not seem to be ...
0
votes
1
answer
41
views
i get black image with rotating code in python
i write this code and all i get is black image when i run it it doesnt rotate. i imported the functions i will use first. then i defined which image i want to rotate with the degree as ...
0
votes
0
answers
67
views
SwiftUI: Resizing and Rotating Image with Drag Gesture Misbehaves After Rotation
I am working on a SwiftUI project where I have an image that can be resized by dragging its corners, moved around the screen by dragging, and rotated by 90 degrees upon tapping a button. I have ...
0
votes
0
answers
46
views
Rotating image does not resize properly using CSS
I have an outer div with a width of 200px that has the image inside it having a width of 100%.
Now if I want to rotate that image by 90 deg, its dimensions are not rotated and I cannot set the width ...
0
votes
1
answer
95
views
Rotate curves in place in pyqtgraph
Is it possible to rotate curves independently of their axis' values in a graph?
I made this test file:
import pyqtgraph as pg
from PyQt5.QtWidgets import QApplication, QMainWindow, QVBoxLayout, ...
0
votes
1
answer
24
views
Rotated text works on Desktop, but is upside down on iPhone
I am using the following CSS to achieve the rotated header that I want on desktop browsers (Edge and Chrome):
To do that I'm using the following style:
.table-rotated-header {
writing-mode: ...
0
votes
0
answers
22
views
How to animate a object's rotation on all 3 axes simultaneous?
I have an empty which i need to be rotating on all 3 axes simultaneous.
It can be done quite easily in Blender 4 using Simulation zone and a transform modifier with values on x,y,z.
Unfortunately i ...
0
votes
0
answers
31
views
How to rotate an <img> but just see the white canvas from behind [duplicate]
I want to rotate an img in y axis but I don't want to see the photo when my img rotete 180 degree. i just want to see the white blank object. The sample code is like below.
<div class="...