rotation

PHP resize image fixed size but maintain orientation

I need to resize images in php using GD to a fixed size but maintain the orientation (portrait/landscape), these are: portrait: 375 x 500px landscape: 500 x 375px Everything I have tried always ignores the orientation and makes them all landscape. Can anyone help? ...

iPhone: Execute code after animation of UIDeviceOrientation change finishes

Not sure if I can explain this correctly, but I am trying to execute a method device orientation animation finishes. Right now I have [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didRotate:) name:UIDeviceOrientationDidChangeNotification object:nil];, but that triggers instantly. Is there a way to have...

Rotation animation is causing error...What is Apple's Updated requirement?

What does this mean and why am I getting this error. Any suggestions on how to fix it? "Using two-stage rotation animation. To use the smoother single-stage animation, this application must remove two-stage method implementations." ...

Is there any algorithm for determining 3d position in such case? (images below)

So first of all I have such image (and ofcourse I have all points coordinates in 2d so I can regenerate lines and check where they cross each other) But hey, I have another Image of same lines (I know thay are same) and new coords of my points like on this image So... now Having points (coords) on first image, How can I determin ...

How to implement translation & rotation widgets for game level editor.

I am developing game editor.To detect mouse hit on 3D model I am using mouse picking concept. But I want to implement translation & rotation widgets like other game editor with actual arrows at the center of model in three direction. How to achieve this..? Can anyone suggest sample code for the same? ...

How to get the rotation value of a UI Element in WPF

I've figured out how to assign a rotation value (element.RenderTransform = new RotateTransform(x)), but how do I get the rotation value of the element? For example, if I wanted to make one ui element have the same rotation angle as another ui element, how would I do that? ...

Rotation of ViewController in TabbarController

I have a custom UIViewController in a UITabbarController and want to respond to rotation events. When a rotation occurs, the tabbarcontroller and the viewcontroller get rotated. However, the view in the viewcontroller doesn't get redrawn properly: the layout doesn't autoresize and it is black on parts of the screen. The strange thing i...

Is there a circular hash function?

Thinking about this question on testing string rotation, I wondered: Is there was such thing as a circular/cyclic hash function? E.g. h(abcdef) = h(bcdefa) = h(cdefab) etc Uses for this include scalable algorithms which can check n strings against each other to see where some are rotations of others. I suppose the essence of the hash...

How to change X and Y of a button

I'm using MonoTouch. When I rotate to LandscapeRight/Left I want to change the location of some of my buttons but I'm not having any success. I'm replacing the button.Bounds with a new rectangleF and setting that value in the WillRotate, but that's not working. I am returning true in my ShouldAutorotateToInterfaceOrientation handler. I...

multidimensional vector rotation and angle computation -- how?

Input: two multidimensional (for example dim=8) vectors a and b. I need to find out the "directed" angle (0-2*Pi, not 0-Pi) between those vectors a and b. And if they are not parallel I need to rotate vector b in plane a,b by "directed" angle L. If they are parallel, plane does not matter, but angle of rotation is still the same L. For...

UI Image rotation is not working

hi, I am developing UI Image based app. i am rotating image using context it giving complete white screen . image is not getting.i used all methods provided by stack overflow , but not able to succeed. Finally i tried using UI Image-view its also not giving rotating image. pleas provide a better option for me. thanks in advance. ...

Problem with Landscape and Portrait view in a TabBar Application

I have an TabBar app that I would like to be in landscape and portrait. The issue is when I go to tab 2 make a selection from my table then select tab 1 and rotate the device, then select tab 2 again the content does not know that the device rotated and will not display my custom orientated content correctly. I am trying to write a pri...

CGAffineTransform does not rotate subview - MKAnnotationView, CGAffineTransformMakeRotation

I have a view that does 1 simple thing: draws an image. I can rotate the image like this: CGAffineTransform transform = CGAffineTransformMakeRotation((CGFloat)radians); self.transform = transform; // WORKS: DRAWS, ROTATES But if I delegate the image-drawing function to a subview, and apply the rotation transform to the subview: C...

2D Inverse Kinematics Implementation

Hi I am trying to implement Inverse Kinematics on a 2D arm(made up of three sticks with joints). I am able to rotate the lowest arm to the desired position. Now, I have some questions: How can I make the upper arm move alongwith the third so the end point of the arm reaches the desired point. Do I need to use the rotation matrices for...

ActionScript applying rotation of sprite to startDrag()'s rectangle bounds

from my main class i call to create a sprite and add it to the stage private function addSwatch(evt:MouseEvent):void { if (stage.getObjectsUnderPoint(mousePoint()).length == 0) { var swatchSide:Number = 100; var newSwatch:Sprite = new Swatch(0 - swatchSide/2, 0 - swatchSide/2, swatchSide, swatchSide); newSwatch.x = mouseX; n...

CSS Rotation & IE: absolute positioning seems to break IE

I'm trying to rotate a variety of text blocks so they are vertically oriented, and position them in very specific locations on a diagram which will be previewed and then printed. CSS rotates the text very nicely in IE, FF, even Opera. But when I try to position a rotated element, IE 7 & 8 (not worried about 6) breaks completely and t...

Set UIView orientation in iphone

Hi, I have a view that i need to rotate to fit the screen orientation. As i can't set the orientation directly onto the view, i need to to the transform myself. However i don't know how to calculate the angle rotation according to current view and old view. Any help would be appreciated Thanks ...

WPF: Rotate a 2D vector

Hello, I want to rotate a given 2D (!) Vector, is there a WPF built-in function for this? Currently I'm doing it manually: Vector v = new Vector(); v.X = 10; v.Y = 10; Vector v2 = new Vector(); v2.X = v.X * Math.Cos(-90 * 180 / Math.PI) - v.Y * Math.Sin(-90 * 180 / Math.PI); v2.Y = v.Y * Math.C...

Quaternion Cameras and projectile vectors

In our software we have a camera based on mouse movement, and a quarternion at its heart. We want to fire projectiles from this position, which we can do, however we want to use the camera to aim. The projectile takes a vector which it will add to its position each game frame. How do we acquire such a vector from a given camera/quatern...

Android widget ImageButton loses image when screen is rotated

I have a widget on my home screen with several ImageButtons which have default background images. Through the configuration activity, I can change the image on any of the ImageButtons. The problem is that when the screen is rotated, the image on the ImageButton disapears and it changes back to the default image. I don't know why this ha...