rotation

CSS “transform: rotate()” affecting overall design with “position: absolute” (not aligning properly)

余生长醉 提交于 2020-01-01 04:40:16
问题 I fear I quite don't know how to explain it as well as I can show it. So I've set up this Fiddle. As you can see, the nav menu is not where it should be. It should be set exactly at the bottom border of the head element and to the left border. I.e. bottom: 0 and left: 0 . However, I'm setting a rotation of -90degs and it is obvious that the absolute positioning on the nav element is happening before the rotation or perhaps rather on the original element as if the rotation didn't exist. I've

Why would I ever want `setRetainInstance(false)`? - Or - The correct way to handle device rotation

瘦欲@ 提交于 2020-01-01 04:08:13
问题 Please correct me if I'm wrong on any of this. This is a kind of clarifying question since I haven't seen it explicitly written anywhere. In Android 4, you can call setRetainInstance(true) on a Fragment so that on configuration changes (which basically means device rotation), the Fragment java object isn't destroyed and a new instance of it isn't created. That is, the instance is retained. This is much more sane and less infuriating than in Android 1-3 since you don't have to deal with

Android: Algorithms for SensorManager.getRotationMatrix and SensorManager.getOrientation()

独自空忆成欢 提交于 2020-01-01 03:42:05
问题 To get orientation as a from of euler angles (e.g., pitch, roll, azimuth) in Android, it is required to execute followings: SensorManager.getRotationMatrix(float[] R, float[] I, float[] gravity, float[] geomagnetic); SensorManager.getOrientation(float[] R, float[] orientation); In the first one, I realize that it uses a kind of TRIAD algorithms; Rotation matrix (R[]) is composed of gravity, geomagnetic X gravity, gravity X (geomagnetic X gravity) --- X is cross product. See codes below: float

Programmatic interface orientation change not working for iOS

99封情书 提交于 2020-01-01 03:40:44
问题 So, I've got a project where I need to force an orientation change when a user presses a button. I've created a sample app on github to demonstrate the issue. @interface DefaultViewController () { UIInterfaceOrientation _preferredOrientation; } Some rotation handling bits - (BOOL)shouldAutorotate { return YES; } - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { return _preferredOrientation; } And a toggle - (IBAction)toggleButtonPressed:(id)sender {

iOS 7+ Dismiss Modal View Controller and Force Portrait Orientation

醉酒当歌 提交于 2019-12-31 20:44:11
问题 I have a UINavigationController as the root view controller of my UIWindow on iOS 7 and iOS 8. From one of its view controllers, I present a fullscreen modal view controller with a cross-dissolve presentation style. This modal view controller should be able to rotate to all orientations, and it works fine. The problem is when the device is held in a landscape orientation and the modal view controller is dismissed. The view controller which presented the modal only supports portrait

Prevent autorotate for one view controller ios7?

北战南征 提交于 2019-12-31 11:10:26
问题 My app can autorotate but I need one of the views to only show in portrait mode and don't know how to achieve this. I tried this (among other things) but the view in question still rotates: -(BOOL)shouldAutorotate { return NO; } - (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskPortrait; } 回答1: This solution explains how to control orientation on individual view controllers, provided they are managed by a navigation controller. In Xcode 5, create a new file of

Three.js - billboard effect, maintain orientation after camera pans

百般思念 提交于 2019-12-31 10:04:06
问题 I have a plane geometry that is always set to face the camera via: plane.lookAt(camera.position); in the update loop. I am using OrbitControls to control the camera. When rotating or zooming the scene, the plane continues to face the camera as expected. However, after panning the scene, while the plane continues to face the camera, rotating the camera appears to rotate the plane as well, so that for example if the plane were to contain text, the text could appear rotated or even upside down

Generic Simple 3D Matrix Rotation Issue

自闭症网瘾萝莉.ら 提交于 2019-12-31 07:15:09
问题 I have a problem with my rotation on my 3D object (It's in java but it doesn't really matter) The background: I have a simple 3d model, and you are a first person player on it, you move your mouse up to look up (I.E Rotate by the 3D's x-axis) and move your mouse down to look down (Rotate in opposite direction) But: I also have the left and right arrow keys to turn left/right (Which rotates the 3D's y-axis) Now the problem is, when I have turned, when I rotate by the x-axis it no longer turns

Java Rotate Image

血红的双手。 提交于 2019-12-31 06:04:08
问题 @Override public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2=(Graphics2D) g.create(); //rotation of player if(player.newDirection) { int rotationX=player.getImage().getWidth(null)/2; int rotationY=player.getImage().getHeight(null)/2; AffineTransform at=new AffineTransform(); if(player.direction==LEFT) { //graphics.rotate(Math.toRadians(90),bufferedImage.getWidth()/2,bufferedImage.getHeight()/2); //graphics.drawImage(player.getImage(), player.getX(), player.getY(),

Rotate a bitmap in android about a point without animation of view

夙愿已清 提交于 2019-12-31 05:34:14
问题 I found some good resources for rotating a bitmap in android here and elsewher eon the net. I am close to getting my code to work but apparently I don't fully understand how the Matrix Translations work. The following is three main functions from my sprite class. THey worked great before I added things to facilitate the matrix rotation (namely in the onDraw I called the draw with just x,y and no matrix). I wrote some test code to add a sprite, and rotate it from 0 to 360 and back to 0 again