rotation

Inactive area after device rotation

Hi all, I don't understand what's wrong in my very simple application with device rotation : I built my view with interface builder. (See screen capture here) I specified <key>UIInterfaceOrientation</key><string>UIInterfaceOrientationLandscapeRight</string> in my info.plist file. I had a (BOOL)shouldAutorotateToInterfaceOrientation:(U...

Subview position issue after UIOrientation (rotation) change

I have a viewController and have added a subview in it programatically. secondView.autoresizingMask = UIViewAutoresizingFlexibleWidth; [self.view addSubview:secondView]; I guess when the device rotates, my mainViewController knows that orientation changed, but the subview (secondView) inside the mainViewController does ...

Optimal rotation of 3D model for 2D projection

I'm looking for a way to determine the optimal X/Y/Z rotation of a set of vertices for rendering (using the X/Y coordinates, ignoring Z) on a 2D canvas. I've had a couple of ideas, one being pure brute-force involving performing a 3-dimensional loop ranging from 0..359 (either in steps of 1 or more, depending on results/speed requiremen...

Algorithm to rotate an image 90 degrees in place? (No extra memory)

In an embedded C app, I have a large image that I'd like to rotate by 90 degrees. Currently I use the well-known simple algorithm to do this. However, this algorithm requires me to make another copy of the image. I'd like to avoid allocating memory for a copy, I'd rather rotate it in-place. Since the image isn't square, this is tricky...

Detecting rotation to landscape manually

hi all, I am working on an iPhone application based on UITabBarController and UIViewControllers for each page. The app needs to run in portrait mode only, so every view controller + app delegate goes with this line of code: (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation { return (interfaceO...

Loading different portrait/landscape UIViews

Hi, I have following View COntroller structure: ScrollViewController LandscapeViewController PortraitViewController Each with its own .nib The app starts in landscape mode where many landscape views are added to a scrollview. Each landscape view has its specific portrait view, so I have to assign like ID's to each of this views. Can ...

rotate an object with touch

I'd like to allow the user to rotate a wheel displayed on the iphone. The center of the wheel is the center of the screen. For now, I manage to rotate correctly in basic situations, following the finger gestures. However I have troubles when I try to react to "throw" gesture: I can't determine the rotation direction from user touches. ...

Visual artifacts on UIView rotation with tiled background image.

I have an iPad app with a standard UIViewController/UIView setup - all rotations are allowed. The UIView draws some tiled image as background (the tile is 256*256 pixels): - (void)drawRect:(CGRect)rect { [[UIImage imageNamed: @"Background.png"] drawAsPatternInRect: rect]; } When I turn my iPad I can see that during the rotation th...

determining if value is in range with 0=360 degree problem.

Hi, I am making a piece of code for DirectX app. It's meaning is to not show faces that are not visible. Normaly it would be just using Z-buffer, but I'm making many moves and rotations of mesh, so I would like to not do them and save computing power. I will describe this on cube. You are looking from the front so you see just one face a...

TableLayout formatting loss after device rotation

I'm seeing a strange issue with a TableLayout after the device is rotated from either orientation. If you load the view in either portrait or landscape mode, the table loads fine. But once you rotate the device, the columns collapse to just fit their width. I would expect that after rotation, the columns would still stretch to fit the...

How to get X,Y,Z rotations of vertices on a sphere at the origin?

Hey, I have a sphere in my game world and i would like to place a plane at each vertex on this sphere for debugging purposes. The planes should be orientated so that they lie flat against the sphere (perpendicular to the normals). The sphere is located at the origin, so all the vertices are relative to that. If my thinking is correct, i...

Changing anchor point in DirectX c++

I would like to build turret, that can rotate in all axis. So the base could rotate in Y axis and the barrel in X/Z axis depending on actual Y value, just like normal turret, that have half ball base and the barrel is cylinder. What is best way to do this in simple DirectX? (I'm not using any prepared packs, because I want to elarn it no...

iPhone multi-touch move, scale and rotate, how to prevent scale?

I have existing code for tracking multi-touch positions and then moving, rotating and scaling the item - in this case an image - appropriately. The code works really well and in itself is perfect, however for this particular task, I need the movement and rotation ONLY. I have spent time trying to work out what is going on in this routin...

Given vector of one axis, how do I find vectors of other two axes?

This is a maths problem I am not exactly sure how to do. The vector is not aligned to an axis, so just rotating 90 degrees around x, y or z won't necessarily give me the other axes. ...

How to get bit rotation function to accept any bit size?

i have these 2 functions i got from some other code def ROR(x, n): mask = (2L**n) - 1 mask_bits = x & mask return (x >> n) | (mask_bits << (32 - n)) def ROL(x, n): return ROR(x, 32 - n) and i wanted to use them in a program, where 16 bit rotations are required. however, there are also other functions that require 32 b...

How do I apply multiple rotation transforms on a Raphael text object?

I have a Raphaël text object that I would like to rotate around an axis some distance away and also rotate the text accordingly so it stays horizontal. I know this is possible using SVG transformation matrices, but the author of Raphaël has stated that they won't be a part of the toolkit anytime soon. Here's some code of what I'd like t...

UIView autoresizingMask problem

In iPad. I have a UIViewController with another UIview inside it, at the bottom. ____________ | | | | | UIView | | Controller | | | | | | X | ------------ The UIView is the X. I define for it an autoresizingMask like this, on the viewDidLoad of the UIViewController self.view...

SVG gradient rotation

Consider rect has fill of linearGradient with two color with rotation of 112 degree. I am following below steps to make it alive Make gradient vertically for that set the values for coordinates x1=0, y1=, x2=, y2= Using transform list values in gradientTransform. gradientTransform="rotate(angle, shapeWidth/2, shapeHeight/2)". but t...

iphone cannot rotate views in TabBar controller

Hello, I am working on an application that consists of a TabBar controller. Within on of its tab, I have a subclass of UITableViewController, within this list I have a Core-plot graph in the first cell and some other data in the 4 following cells. When I return YES in the shouldAutorotateToInterfaceOrientation method, I would expect the...

Transform.Translation problem on rotation

I am using the following to scale and reposition a UIView layer when the device rotates to landscape. [containerView.layer setValue:[NSNumber numberWithFloat: 0] forKeyPath: @"transform.translation.x"]; [containerView.layer setValue:[NSNumber numberWithFloat: 0] forKeyPath: @"transform.translation.y"]; [containerView.layer setVal...