rotation

Set up view in code that changes with orientation

Hi, I have set up an application and used some of the basic code from "The iPhone Developer's Cookbook" to create a simple view. The application works correctly in portrait mode, but when it is rotated, the dimensions of the boxes stay the same. Here is my code: - (void)loadView { //Create the full application frame (minus the stat...

How to get unrotated display object width/height of a rotated display object?

If I create a rectangle with 100px width and 100px height and then rotate it, the size of the element's "box" will have increased. With 45 rotation, the size becomes about 143x143 (from 100x100). Doing sometimes like cos(angleRad) * currentWidth seems to work for 45 rotation, but for other bigger angles it doesn't. At the moment I am ...

How to detect element transformation type (scale, move, rotate) for rotated elements depending on cursor position?

The situation I've written the following method (in actionscript 3, it's a flash application) which returns what transformation type is required for the current mouse position in relation to a given element position. An element can be moved, scaled and rotated. This method returns if any of these transformations are applicable with the...

Is there a fast way to calculate the smallest delta between two rotation values?

There are two views: viewA and viewB. Both are rotated. The coordinate system for rotation is weird: It goes from 0 to 179,999999 or -179,99999 degrees. So essentially 179,99999 and -179,99999 are very close together! I want to calculate how much degrees or radians are between these rotations. For example: viewA is rotated at 20 de...

Java 2D - Drag Mouse to rotate Image Smoothly

What is the logic that goes behind rotating an image via mouse movement. I know how to rotate using graphics2d.rotate...but having difficulty doing it with the mouse as the source for rotation. Here is basic steps: get mouse x(dx) and mouse y(dy) distances from anchoring point( in this case that would be the center of the image we w...

How to get visual corner (eg. topLeft) of rotated displayObject in actionscript 3?

When rotating a display object (around its center) the visual corner of the element moves (the actual x and y of the "box" remains the same). For example with 45 degrees of rotation the x coordinate will have increased and the y coordinate will have decreased as the top left corner is now at the top center of the "box". I've tried to us...

Looking for a rotation widget for java

I have a function in my java app that rotates an image by x degrees. Right now I pop up a simple JOptionPane that collects the rotation angle as a double from the user. Is there a java widget that would allow the user to click / drag to a point on a circle to set the rotation angle visually? Already checked out: AWT, SWT, Swing ...

rotation, translation in opengl thorugh header file?

i've a header file called base.h which has all initial display and stuff like, my main aim is to simulate a robot with degree of freedom. class center_rods { public: center_rods() { } void draw_center_rod() { glPushMatrix(); glTranslatef(0,1,0); ...

Hiding UITabBar when rotating device iPhone

Has anyone successfully hidden a UITabbar when rotating the device? I have one view in the UItabbar controller that i rotate (So effectively one tab that rotates) When this happens i want the tab bar to disappear... but nothing seems to work! Either the tabbar still remains visible Or it disappears along with the view Or the tabbar ...

iphone Animation: why does rotating a UILabel around X axis cut off its bottom half?

I want to rotate a UILabel around the X axis, and animating it. But when the animation starts, the text of the label is cut in two, horizontally. The bottom half disappears, the upper half is rotating. Why? Here's the code: CATransform3D _3Dt = CATransform3DMakeRotation(radians(90.0f), 1.0, 0.0, 0.0); CABasicAnimation *transformAnimat...

How to efficiently rotate and translate a plane in 3D

I have a plane defined by a normal (n) and a distance (d) (from the origin). I would like to transform it into a new system. The long way is like this: 1) multiply distance (d) with normal (n) resulting in a a vector (p) 2) rotate (R) and translate (v) the vector (p) to get (p') 3) normalize (p') to get the normal 4) use another algorith...

Windows Mobile / Directdraw: Rotate video stream

Follow up from: http://stackoverflow.com/questions/2289637/windows-mobile-directdraw-display-video-stream-take-picture I managed to preview the camera's video stream, but the image is rotated by 90° to landscape mode. I'm now searching for a way to rotate the camera image back to normal, but the problem is I don't even know where to sta...

Actionscript 3D how to rotate around 3d coordinates

I wanted to write a simple 3d image rotating around the y-axis as the Image carousel. I can place all the photo around the axis but I can't get the main image facing towards the screen. I mean the z-axis isn't pointing towards the screen. Instead, the z-axis is towards the top left corner. How do i make the z-axis pointing perpendicula...

Rotate with momentum

Hello! [In Flex 3] I am looking to implement the following effect: When mouse crosses a Canvas container, make that Container rotate and take into account the speed of the mouse crossing giving it some momentum or inertia based on that speed. How can I do this please? Thanks! ...

cycle through images via jquery

I have five divs on my page (#art #fashion, #self, #nightlife, #community). right now, when you mouseover them, they load page content into another container div (#flyer). I would like the flyer content to cycle every 5 seconds or so. So, instead of having to mouseover those 5 divs, it should just automatically go. does that make...

Rotating only the MapView's content

Hello. I am trying to rotate a map view in my app according the the user's current route. (I don't like to use the built in compasse because only 3GS uses it and it suffers too much interference from other machines, i.e. your own car.). the CGAffineTransformMakeRotation method will rotate the Whole Map View, so the Google Logo will not ...

How to create a vertical color gradient (or any other angle besides a flat horizontal gradient)

Hey everyone, my first time trying to draw a multi-color gradient in actionscript 3. So I got this code from the help docs, but I can't seem to get a vertical gradient, whatever formula or number I use for rotate, it stays stuck on the default horizontal gradient :( You can view my gradient here My Code: You can see in the traces the...

Flash movie that reads html values and rotates them every 10 seconds

I was wondering if it is possible to create a flash movie that rotates values that are stored in HTML. For example if i have these 3 containers: <div style="display:none"> <img src="someimage1" /> <span class="text1">text1</span> <span class="text2">text2</span> </div> <div style="display:none"> <img src="someimage2" /> ...

360 rotation degrees to 2d object from 3d papervision object in actionscript

Hey guys, Some reason I've been struggling with this for a while. I have a papervision camera of which turns using keyboard input, I have a radar of which I would like to orientate to direction when the camera turns. I have it all working apart from mapping my (camera) DisplayObject3D.rotationY to RadarInterface.rotation correctly. T...

Rotate button around center

Hi, I'm searching for a way to create a menu in an iPhone app that allows buttons to rotate around a center point. To put this in visual terms: the buttons would be planets and the center is the sun. this would allow the user to 'spin' the buttons around the circular path. ** an actual example of this would be the Poynt menu for the...