Questions tagged [rotation]

1

votes
2

answer
2.6k

Views

Racing game with following camera

I'm trying to figure out how to create a racing game in flash (like many tutorials already out there on the web). However instead of keeping the level static and moving the car around - Is it possible to keep the player's car motionless in the center of the screen and rotate the level around the pla...
PROWNE
1

votes
3

answer
59

Views

Codility CyclicRotation Javascript Solution: Empty array returns an error

I am trying to solve this problem in codility. My solution passed all the tests except for one with empty array and rotation of 1 as arguments. I'm someway lost of how to even approach for solving this issue. Could someone please nudge me in the right direction? Other than writing a specific if clau...
Nika Bo
1

votes
3

answer
39

Views

C# Rotated DrawString from Right Corner

I am trying to draw text on an image from top right corner towards the bottom left corner. My code mess up the positioning of drawstring. so far this code drawing like this but I need help to draw text between these red lines. string img_src = 'F:\\blank_imge.jpg'; System.Drawing.Image selected_img...
Arbaz Abid
1

votes
1

answer
35

Views

Why matrix to raster shows up rotated?

I am trying to convert a matrix (myMat) to raster data (myRas); however, I am not sure why this rotates all of a sudden. This can be easily fixed by 90-degree rotation using t() but, I will be grateful if someone explains why this unwanted rotation happens all the time?! and if there is a way to pre...
Majid
1

votes
2

answer
227

Views

Prolog - Creating a list of all the possible shifts of another list?

For my assignment I need to create a list of all the possible shifts (rotations) of another list in prolog. For example, Prototype: all_shifts(+A,-R,+L,+S) *S will always start at 1* ?- length([1,2,3,4],L), all_shifts([1,2,3,4],R,L,1). L = 4, R = [[2, 3, 4, 1], [3, 4, 1, 2], [4, 1, 2, 3]]. Currentl...
nhlyoung
1

votes
0

answer
20

Views

Pinning the bottom cell of a tableview on rotation

Just like in Telegram or Whatsapp, when the device rotates, the bottom cell should stay anchored to the bottom of the screen. However, when I rotate my device, the top cell is being anchored and stays foot. Couldn't find any solution online. Here is how I want a rotation to look like:
Nimrod Shai
1

votes
0

answer
106

Views

3D rotation ratios via mouse placement on screen - Java

I am making a 3D game in which the player can rotate their view point via the mouse to look around the environment. I firstly just did x and y rotation via vertical and horizontal movement of the mouse and z via another control. But after playing the game I realised it did not rotate correctly. NOTE...
youeffoh
1

votes
1

answer
45

Views

Limited rotation towards mouse

I have 2D game (unity, c# scripts), where is a submarine with tower (parent) and gun (child). look at the screenshot Tower can rotate (when I press A or D) around submarine body. (works fine) Problem is the gun on tower should rotate towards mouse, but only in angle limitation. Angle limitation (by...
DohnnyJepp13
1

votes
1

answer
410

Views

rotate Z axis on 2d image's matrix in shader

I'm trying to rotate a 2d image's matrix inside the vertex shader. I want the 2d image to rotate around what I think would be the z axis. However The closes I've ever gotten is: Here is my matrix inside my shader that I apply translation and scaling on: mat4 worldPosTrans = mat4(vec4(scale.x * cos(...
Elias
1

votes
0

answer
131

Views

Accurately measure yaw using Rotation Vector Sensor

I am trying to measure the angle about the Z-axis(yaw) of an android device. I attempted to do this by using a Rotation Vector sensor. The reported angles, however, are inaccurate. For example, if I rotate the phone 90 degrees couter-clockwise, the angle changes by about 30 degrees. Is there any way...
E7_82_8E
1

votes
0

answer
65

Views

Scaling UIView after Rotation causes jump in initial scale

I have a view which I would like to scale and rotate with gesture recognisers. I calculate new bounds for scale like so: let newBounds = moveView.bounds.applying(CGAffineTransform.identity.scaledBy(x: scalee, y: scalee)) And it works fine without rotation getting involved. After simple CGAffineTrans...
HelloimDarius
1

votes
0

answer
39

Views

Controlling rotation path in Unity3D

On my top down 2.5D shooter game, I am usingQuaternion.LookRotation() and Quaternion.Lerp() to change the rotation of my player towards a click. The player rotates just fine, but I need more control over the rotation path. The issue here is that the LookRotation() always returns the shortest path...
Fabio S.
1

votes
0

answer
32

Views

Compute integral of a “map” along a given direction

EDIT: this is for Python! Im trying to compute an integral of a 'map' to produce a line density but I want my integration direction to vary based on the map itself. Here is the idea: Now, the test case that I am using is the following picture: So I want to integrate along the cross direction of the...
Aalok Parkash
1

votes
1

answer
117

Views

Rotate QGraphicsCustomItem into a QGraphicsScene

i'm a newbie with c++ and QT, but i've trying to learn as much as i can i've created a simple class (called MainWindow) and with Qt Creator (Qt 5.10.0) i set a QGraphicsView into the Mainwindows.ui inside the Mainwindow costructor i've created a QGraphicScene (linked to the QGraphicsView item) that...
Pierluigi Rovere
1

votes
0

answer
117

Views

How does parameters impact on rectification process?

Why does rectification work like this? Please can someone explain me it in details? How does extrinsic parameter affect rectification result? 1) I build the set of stereo cameras where I can rotate them as I want to. My input images: 2) I calibrated them using Matlab and confirmed by Kalibr method....
MichalSzczep
1

votes
0

answer
107

Views

Javafx - change shape RotateTransition start point

I am trying to rotate multiple spheres around one object in the center and the challenge I am facing now is how to put different start points (maybe angle?) for the shapes so that they all don't start right from the same spot all at once. This is my code : Sphere earth = new Sphere(2); earth.setTran...
J. Doe
1

votes
0

answer
38

Views

How do I rotate a 3D object relative to its orientation using quaternions?

As a learning experience, I'm trying to build a simple 3D game without any libraries. I've managed to figure out rendering (for the most part), and I've gotten 4D matrix transforms to work well enough. I'm having trouble rotating my player object relative to its own orientation; I want to build an a...
Peter N Wood
1

votes
1

answer
44

Views

Javascript rotate mouseover pause?

I'm trying to modify a word dial, but am not much of a javascript pro(yet). How can I pause this dial on hover/mouseover within the existing code.................................................................................................................................................. html: I...
Jose Rodrigo Gomez
1

votes
0

answer
26

Views

Someone has animation skills in Android Studio?

I´ve got one rotation animation to rotate one imageView around one fix position (the center). Now i want to know in every second where the imageView, which rotates, is. In other words the imageView wich rotates is a circle and i want to know the center point of this imageView during animation. This...
Chralt
1

votes
0

answer
88

Views

Minimum Moves to get Lexicographical Smallest Value by Rotating the string

I'm doing a problem to get the minimum moves it takes to get the smallest lexicographical value of the given string. I first added the string and rotated it to store on the map with it's key as the move. Then I returned the first key of the Map which gives me the maxMoves to get that minimal lexicog...
Prashul Shrestha
1

votes
1

answer
705

Views

How to remove fade animation of UICollectionView during rotation time?

I am just trying to adapt animation of CollectionView during rotation time , so that there wouldn't be any fade effects like this Just simple move of the view. So after a small search i found out that I accomplish that effect by just overriding two methods of UICollectionViewFlowLayout override f...
Ninja
1

votes
1

answer
151

Views

How do I rotate around a point towards the mouse in PaperJS?

I'm creating a simple game using PaperJS and I'm currently stuck on a small part of it. In the game, there is a player (just a circle) who has two hands (two smaller circles) I want the hands to always point towards the mouse position, but I can't figure out the equation needed to do so. Here's some...
Evan Wild
1

votes
1

answer
376

Views

Leap Motion - Angle of proximal bone to metacarpal (side to side movement)

I am trying to get the angle between the bones, such as the metacarpal bone and the proximal bone (angle of moving the finger side to side, for example the angle when your index finger is as close to your thumb as you can move it and then the angle when your index finger is as close to your middle f...
user7856951
1

votes
1

answer
385

Views

How to make an Xcode playground rotate to landscape

I am trying to test a landscape view, but so far I cannot make progress. My code looks like this: import UIKit import PlaygroundSupport class MyViewController : UIViewController { override func loadView() { let view = UIView() view.backgroundColor = .white let label = UILabel() label.text = 'Hallo'...
Coti Garcia Bermejo
1

votes
1

answer
993

Views

Unity3D angle between vectors/directions on specific axis

I have two directions and i am trying to calculate the angle on a specific axis. The object from which the directions are derived is not a static object so i'm struggling to get my head round the maths to work out what i need to do. FYI, I have the start and end points that i have used to calculate...
user7856951
1

votes
0

answer
77

Views

Restore Recycler View state on device's rotation

I have RecyclerView which views are populated from the internet (page number is a parameter) and that is why I used the EndlessRecyclerViewScrollListener. The only problem is that when I rotate the device, it doesn't restore the same state. This is my ScrollListener initiation in onCreate(): mScroll...
Mike
1

votes
2

answer
303

Views

Create UIDeviceOrientationDidChangeNotification event manually

Can we create UIDeviceOrientationDidChangeNotification event manually? In AppDelegate.swif I have func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask this method will return a result depends on user setting. It work well...
omar.zhou
1

votes
1

answer
34

Views

UIImage View Not Rotating on Forced Landscape

I am forcing the landScape of my ViewController to .landscapeRight. The ViewController is followed by a NavigationController with no set class(default). let appDelegate = UIApplication.shared.delegate as! AppDelegate appDelegate.myOrientation = .landscapeRight However, the UIImage and the navigation...
husharoonie
1

votes
1

answer
628

Views

How to rotate logs daily in rabbitmq

I want to rotate rabbitmq logs daily. It is mentioned in the following link that rotation can be configured using following properties. log.file.rotation.date, log.file.rotation.size, log.file.rotation.count. https://www.rabbitmq.com/logging.html how can I configure daily rotation using these parame...
Sainath Batthala
1

votes
0

answer
81

Views

Javascript (Jquery) detect orientation change on Microsoft Surface

I'm trying to detect orientation change on Microsoft Surface. I tried to bind 'orientationchange', 'resize' event but it not working on Microsoft Surface (Ipad and other tablet working fine). Any idea for it?
hoangthong2204
1

votes
0

answer
463

Views

How to use logrotate to compress files older than 1 day

I've have a list of files below which I wants logrotate to compress if its a day old. So I'm expecting TRACE_03.log, TRACE_07.log, been compressed as it is more than 24 hrs # ls -ltr total 2083312 -rw-r--r--. 1 root root 198176768 Mar 18 01:30 TRACE_03.log -rw-r-----. 1 root root 198176768 Mar 19 17...
Gavin Yap
1

votes
0

answer
133

Views

How do you rotate a video from a URL in Swift?

I have my AVAssetWriter's completion handler create an exporter after it has finished writing so that the video can present itself in a player so the user can save it if they wish. That is all well and good, but I'd like to alter the written video and simply rotate it after it has finished writing....
1

votes
1

answer
89

Views

Captured frame is rotating 90 degree right in the Server

Frame or image is captured from the Video sent by the android mobile, Used Jcodec(jcodec and jcodec-javase Version 0.2.2) to capture the image in java. Everything is working fine but while displaying the photo is tilted to right 90 degree. I am not able to find that rotating is happening while capt...
User
1

votes
1

answer
75

Views

OpenGL Rotation Stop/Start Button

I need to create a start/stop button to start or stop the animation of a rotating square , I used a loop variable to decide if the square should rotate or not; in the render() function , if loop = 1 the square must rotate , if loop = 0 it stops. At the beginning loop=1 so the square is loaded in the...
1

votes
0

answer
51

Views

eulerAngles reading is wrong between 90 and 270 degrees

I'm trying to rotate a light source between 8 stages, (including Sunrise, noon, etc.) The problem is that after it rotates through 270 (Going down) the value, read from the console, starts going up again and remains wrong until it reaches 90 when it once again gives the right one. The main bit of th...
Rich Cat
1

votes
0

answer
77

Views

R prcomp PCA rotation incorrectly mirroring data

Has anyone had any issue with R's prcomp PCA rotation function rotating THEN MIRRORING the data? When I use principle from the psych package, the rotation is correct. Also, when I do it manually with cosine angle, it is correct. But when I do prcomp, it mirrors the data after rotating it. prcomp has...
b1234
1

votes
0

answer
122

Views

Video rotation not applying for AVAsset when setting AVAssetExportSession's videoComposition

I simply would like to rotate a video 90 degrees after capturing it. I followed the answer in this thread: iOS how to correctly handle orientation when capturing video using AVAssetWriter When my asset finishes writing, I call the method to set the properties for the video, and then it exports. asse...
1

votes
2

answer
413

Views

Google Widevine DRM Key Rotation

Can Widevine DRM client player maintain a log of the keys that have been used for content decryption? The logs could be useful to derive certain statistics, such as to identify till where the content was viewed. Also, are the keys that are received in 'pssh' data blogs also encrypted with certain t...
John Smith
1

votes
2

answer
45

Views

Pass array to function (C)

I've written a function to rotate an array, I've checked and it works when code is in one block I.E. everything is coded under main(), but when I divide the code so that the rotation is done under a different function I can't get it to work (it truncates instead of rotating). I'm pretty sure it's s...
NOOBAF
1

votes
1

answer
434

Views

Rotating matrix that represents bounding box by X degrees

I have image, that is rotated by 30deg. However i need to rotate the bounding box too. The coordinations of bounding box are [xmin,ymin,xmax,ymax] = [101,27,270,388] (xmin,ymin) = top left corner , (xmax,ymax) = bottom right corner. Now i wanted to rotate this matrix by running it over rotations mat...
Darlyn

View additional questions