rotation

Fast plane rotation algorithm?

I am working on an application that detects the most prominent rectangle in an image, then seeks to rotate it so that the bottom left of the rectangle rests at the origin, similar to how IUPR's OSCAR system works. However, once the most prominent rectangle is detected, I am unsure how to take into account the depth component or z-axis, ...

how do I find the angle of rotation of the major axis of an ellipse given its bounding rectangle?

I have an ellipse centered at (0,0) and the bounding rectangle is x = [-5,5], y = [-6,6]. The ellipse intersects the rectangle at (-5,3),(-2.5,6),(2.5,-6),and (5,-3) I know nothing else about the ellipse, but the only thing I need to know is what angle the major axis is rotated at. seems like the answer must be really simple but I'm ju...

opengl rotation using gldrawpixels

Hi all, My team is currently limited to drawing images on an opengl 1.4 platform, which means that we can't use any nifty texture mapping to draw an image (yes, we're confined to using the intel integrated graphics platform, it's very annoying). So far, we're able to draw, scale, and flip an image, but the guy doing the graphics claim...

Tetris Piece Rotation Algorithm

What are the best algorithms (and explanations) for representing and rotating the pieces of a tetris game? I always find the piece rotation and representation schemes confusing. Most tetris games seem to use a naive "remake the array of blocks" at each rotation: http://www.codeplex.com/Project/ProjectDirectory.aspx?ProjectSearchText=t...

Finding Rotation Angles between 3d points

I am writing a program that will draw a solid along the curve of a spline. I am using visual studio 2005, and writing in C++ for OpenGL. I'm using FLTK to open my windows (fast and light toolkit). I currently have an algorithm that will draw a Cardinal Cubic Spline, given a set of control points, by breaking the intervals between the po...

OpenGL rotating a camera around a point

In OpenGL I'm trying to rotate a camera around a point, with camera being distance r from the point and facing the point when it rotates. In other words, I want the camera to move along the circumference of a circle at a radius r from the center, with the camera facing the center at any point along the circumference. Lets say that in ...

How can I retrieve the layer from a view?

I would like to do a transformation (rotation) to a UIImageView, I could just set the transform property of the view, but would setting the layer's transform make it faster? If so.. how can I achieve this? assuming I have a UIImageView initialized with an image, can anyone help? would it be better have a UIVIew with a UIImageView in it?...

How can I display one UIView in landscape?

I've looked at every question so far and none seem to actually answer this question. I created a UITabBarController and added several view controllers to it. Most of the views are viewed in portrait, but one should be viewed in landscape. I don't want to use the accelerometer or detect when the user rotates the device, I just want to ...

Activity restart on rotation Android

In my Android application, when I rotate the device (slide out the keyboard) then my activity is restarted (onCreate is called). Now, this is probably how it's supposed to be, but I do a lot of initial setting up in the onCreate method, so I need either: 1. Put all the initial setting up in another function so it's not all lost on device...

Rotating flash movie clip

I would like to do a flash menu similar to this company's, I have the rotation down, I just cannot figure out how to make it rotate to the top. For example, if you click "Financing" on their menu, the word financing rotates to the top. If someone could just give me the theory behind how to do that, that would be awesome. EDIT: I guess ...

Linux/c++ log rotation scheme

I have a logger system which basically is a fancy way of writing my data to std::clog in a thread safe way. I also, redirect std::clog to a file like this: int main() { std::ofstream logfile(config::logname, std::ios::app); std::streambuf *const old_buffer = std::clog.rdbuf(logfile.rdbuf()); // .. the guts of the applicat...

Rotate an AS3 Dynamically created object

I'm building a site that requires an audio file to be played with an equalizer. I don't know alot about AS3 yet so this might be a simple question. I've found an example that I would like to use Demonstrated here and the source files here The code to add the equalizer object to the stage (from the tutorial) package { import flash...

Button Rendering Incorrectly after Rotation Transformation within a Silverlight Control

It looks like the width of a child silverlight control is always clipped by the width of the container. Even if the child control is rotated. This first "chunk" of XAML will render a Button that is too large for a stack panel and is clipped, this makes sense. <StackPanel Width="20"> <Button Width="100" Content="Foo" /> </StackPane...

Applying in-place tranformations to 3D Model in WPF

I have a simple 3D cube that I can rotate using the following code: void mui3D_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { RotateTransform3D rotation = new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(0, 1, 0), 0), mui.Model.Bounds.Location); DoubleAnimation rotateAnim = ne...

finding center of 2D triangle

(Yes, unfortunately, this is a homework question) I've been given a struct for a 2D triangle with x and y coordinates, a rotation variable, and so on. From the point created by those x and y coordinates, I am supposed to draw a triangle around the point and rotate it appropriately using the rotation variable. I'm familiar with drawing...

Can't use ImageSnapshot.captureBitmapData with a rotation matrix

Does anyone have an example of using the ImageSnapshot.captureBitmapData function with a rotation matrix? This is the code I'm using: var matrix:Matrix = new Matrix(); matrix.rotate(degreesToRadians(90)); var bitmapData:BitmapData = ImageSnapshot.captureBitmapData(textInput, matrix); But unfortunately this throws an error on the follo...

How can I rotate and compress Log4perl log files?

From what I can tell neither Log4Perl or any of its related modules in CPAN supports rotate & compression of log files. Rotation can be accomplished by using: Log::Log4perl::Appender::File Log::Dispatch::FileRotate. But neither modules supports rotation and compression. (Log::Dispatch::FileRotate has it in its todo list, but it's n...

Rotation & OpenGL Matrices

I have a class that holds a 4x4 matrix for scaling and translations. How would I implement rotation methods to this class? And should I implement the rotation as a separate matrix? ...

How does zooming, panning and rotating work?

Using OpenGL I'm attempting to draw a primitive map of my campus. Can anyone explain to me how panning, zooming and rotating is usually implemented? For example, with panning and zooming, is that simply me adjusting my viewport? So I plot and draw all my lines that compose my map, and then as the user clicks and drags it adjusts my vi...

WPF: Collision Detection with Rotated Squares

With reference to this programming game I am currently building. Thanks to the answers from this post, I am now able to find the x-y coordinates of all the points of the rectangles (even when rotated), and Collision-Detection with Walls is almost working perfectly now. Now I need to implement collision detection with the bots themselve...