FAQ Database Discussion Community


Rotate image by x degrees? - Java [duplicate]

java,image,rotation,image-rotation
This question already has an answer here: Java: Rotating Images 4 answers All right, so I am attempting to create a simple-ish game and I have a galaxy swirly id like to rotate, only thing is though, I am unsure how, if I use the Graphics2D "g.rotate(x)" everything on...

Stack overflow on logging python module

python,logging,rotation,handler,stack-overflow
I'm having a problem with python 3, I'm trying to log the stdout and the stderr to a log file. I was able to figure it out using http://www.electricmonk.nl/log/2011/08/14/redirect-stdout-and-stderr-to-a-logger-in-python/ The point of it was to have both the log file and the console output as normal, while using only the...

How to spin and rotate in css?

html,css,rotation
I have tried spinning and sliding seperately and they work fine. But when I combine them they have an awkward combo. http://jsfiddle.net/62RJc/268/ img{ border-radius:50%; -webkit-transition: -webkit-transform .8s ease-in-out; -ms-transition: -ms-transform .8s ease-in-out; transition: transform .8s ease-in-out; } ...

Getting the axis pointing up in a rotation (Unity)

unity3d,rotation,axis
I have an object in unity which has a rotation described as the following: x, y, z, where they are both rotations ranging from 0 to 360 around their respective axis. Now I'm trying to find out which of the vectors point up the most. Essentially I have a 6-sided...

Rotating four lines around a common point

c++,vector,rotation
I have four lines held in a Rectangle object. I'm trying to rotate the entire box by any angle, but I'm getting weird results. Here's my current code: void Line::rotate(int x_anchor, int y_anchor, double angle) { // Change the coordinate system int xOffset = m_pt1.x() - x_anchor; int yOffset =...

CSS transform rotate in the same direction each time

javascript,css,rotation,transform,transition
I'm wanting to make an element on a web page rotate 360 degrees anticlockwise each time a button is clicked. I've found some example code showing how to do this but the only issue is that currently it rotates in alternating directions. Is there a simple way to ensure that...

Find rotated div top position from left

javascript,jquery,html,rotation,position
I want find top position of rotated div from element.can any one help me. i can able find top position of element but I want top(Y pos) position from left(x) position. I am used this var degree = degree; if (degree < 0) { var sign = -1; } else...

How to animate along with device rotation on iOS 7

animation,ios7,ios8,rotation
I want to do some animation along with device rotation. On iOS 8, I can do this: - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator { [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; [coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context) { // My custom animation } completion:nil]; } But this method is not available on iOS 7. I tried to do the similar...

On click Javascript transform

javascript,css,rotation,click
I am trying to achieve a flip card effect on the click of a button but I can not quite figure out the Javascript. I actually know nothing about Javascript so I have attempted to find similar solutions and alter them to my needs but with no results. Below is...

How to rotate points about a specific origin?

c++,matrix,rotation,sfml,points
I'm working on rotating the vertices of my object around a point located on the object that's not necessarily its center. I followed this tutorial pretty closely and got the vertices to keep their same proportions, i.e. the shape that they create does rotate about the given point, however the...

raphael js drag rotation in Firefox and Internet Explorer

javascript,rotation,raphael,drag
I am new to the SVG and Raphael world and am trying to create a radial dial that has a draggable needle. The drag works fine in Chrome, Safari, and Opera. In Internet Explorer the movement is very jittery and and will often return to it's initial starting position. In...

unity rotation difference and direction

c#,unity3d,rotation
I would like to know the rotation difference between two objects on one Axis, like for example on Y axis. I tried using Quaternion.Angle but it calculate whole rotation, not on one axis using angle=transform.rotation.eulerAngles.y-target.transform.rotation.eulerAngles.y; works, however this does not tell me the target's direction compared to me, how many...

Get current rotation in degrees of group in snap.svg

svg,rotation,snap.svg
how do i get the current rotation in degrees of a element in snap.svg? I can set a tranform but i find no easy way of getting a value. A typical group looks like this. <g transform="matrix(0.5154,0.5154,-0.5154,0.5154,64.3512,5.239)"><text x="0" y="0" style="font-size: 12px;">Change text</text></g> ...

openGL rotation reset

c++,opengl,rotation
I am currently viewing a set of spheres and rotating them around x, y, z when the button x, y or z is pressed respectively. Rotation works. But when I reset my rotations with i, I don't always get a perfect reset. case 'x': case 'X': glMatrixMode(GL_MODELVIEW); glutSetWindow(windowID[0]); glRotatef(1, 1,...

Separating axis theorem: rotation around center of mass

c++,math,rotation,rotational-matrices,separating-axis-theorem
The problem is in Polygon::FindAxisLeastPenetration: double Polygon::FindAxisLeastPenetration(unsigned int *faceIndex, const Polygon &polygonA, const Polygon &polygonB) const { double bestDistance = -std::numeric_limits<double>::infinity(); unsigned int bestIndex; for (unsigned int i = 0; i < polygonA.points.size(); i++) { Vector2D n = polygonA.normals[i]; Vector2D nw = polygonA.rotationMatrix * n; //ROTATION Matrix22 buT = polygonB.rotationMatrix.Transposed();...

Apply scale and rotation to a specific point - Javascript

javascript,math,rotation,transform,scale
We've been having some trouble with scaling AND rotating a point in relation to another div. Essentially we have 2 layers, one with and image(svg) and another layer with icons that are placed on the image. We've been able to rotate the icons based on the image's rotation (and position),...

Needle rotating about its pointer head

android,animation,rotation
I have a needle image that I need to rotate when a given value changes. The values obtained are random. I created the Image in xml which is an imageview. <RelativeLayout android:id="@+id/relativeLayout1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_centerInParent="false" > <ImageView android:id="@+id/meter_image" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true"...

Unexpected vector rotation value

javascript,math,vector,rotation
So I have a vector (split into two seperate values for learning purposes). I have it set to to: var px = 6*( Math.cos( originalAngle * (Math.PI/180))); var py = 6*( Math.sin( originalAngle * (Math.PI/180))); Which sets the X coordinate (px) to 6 and sets the Y coordinate (py) to...

Rotate clip art in android

android,view,rotation
I created an Android app which consists of adding some moustache. I don't know how to make it rotate. Can someone please provide the code to accomplish this?

google can't maps api rotate marker

javascript,google-maps,google-maps-api-3,rotation
Im having some problem rotating my marker at google maps api. Im currently doing: <script> function initialize() { var mapProp = { center: new google.maps.LatLng(51.508742, -0.120850), zoom: 4, minZoom: 2, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map"), mapProp); var myLatlng = new google.maps.LatLng(-51.508742, -0.120850); var image = 'http://wcdn1.dataknet.com/static/resources/icons/set73/f3eef3d2.png'; var...

rotating around objects

opengl,rotation,jogl,coordinate,orbit
I've been trying to make one object orbiting another: //childX,childY,childZ are my starting coordinates //here I count distance to the middle of my coordinate plane float r = (float) Math.sqrt(Math.pow(childX, 2)+Math.pow(childY, 2)+Math.pow(childZ,2)); //here i convert my angles to radians float alphaToRad = (float) Math.toRadians(findParent(figure.parentId).rotate[1]);//up_down float betaToRad = (float) Math.toRadians(findParent(figure.parentId).rotate[0]);//left_right float...

Rotating an Image object

java,image,graphics,rotation,bufferedimage
I have a method getImage() that needs to rotate an Image, store it in a new variable, then return that new Image. Here is my attempt, the image appears to be empty or something. It just does not show up on the screen: public Image getImage() { buffImage.createGraphics().rotate(direction); return buffImage;...

Using MMDrawerConroller how to disable rotation is some ViewControllers?

ios,objective-c,uiviewcontroller,rotation,drawer
I am using MMDrawerController in my application from this link I set the root ViewController in the AppDelegate this way: self.leftDrawerController = [[LeftDrawerViewController alloc] init]; self.homeViewController = [[HomeViewController alloc] initWithNibName:@"HomeViewController" bundle:nil]; self.navigationController = [[UINavigationController alloc] initWithRootViewController:self.homeViewController]; // DrawerViewController setup self.drawerController = [[MMDrawerController alloc]...

SVG Animation rotate group around its center

css,svg,rotation,centering
I have a svg image that contains a circle group and a text group. The circle group consists of multiple dots. This Circle group should rotate around its circle center, but it keeps rotating around the svg's top left corner. To solve this issue I have searched everywhere, but I...

CSS3 animation function for smooth 3D revolution?

css,css3,rotation,css-animations
I have this pen which tries to emulate an object revolving around something. This works, but it isn't smooth. While revolving it pauses around the left and right edges. I thought it had something to do with animation-timing-function but can't get the desired result with any of the in-built functions...

How to Rotate Akamai Client Credentials

rotation,akamai
I am using the LUNA API to control my GTM profile. To access the API, I had created client credentials from LUNA Control Center (Configuration > Manage APIs), which generates a set of secrets (i.e. client token, access token, client secret and unique URL). I have read in their documentation,...

Rotation on Y axis in degree or radians in iOS

ios,rotation,accelerometer,gyroscope,core-motion
I need to get Rotation for iDevice on portrait mode, around Y axis of accelerometer, as per shown in this image, (reference: https://developer.apple.com/library/ios/documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/motion_event_basics/motion_event_basics.html) How can i get rotation performed around Y axis, either in positive or negative. I've implemented few codes from stackoverflow/Apple code, i get no difference in roll,...

Rotating array with one fixed value

c#,arrays,rotation
I'm building a strong logic and randomized keygen with at base the 'partial key verification'. I need to add it another random function by rotanting an array but all sample i found here at Stack Overflow have different needs as mine. I'm starting with an array: int[] q = new...

3D ball map rotating in HTML5 canvas

javascript,html5,canvas,3d,rotation
I have created a multiplayer pool game in HTML5 canvas and it is working just fine. I would like to enhance it with real ball rotations. Now I'm using simple png files for balls which cannot "rotate" in any direction (they can but it is not real). Is there any...

Efficiently getting Custom Image View Dimensions after View.PostRotate(angle) in android

android,rotation,scaling
I am having a trouble with my custom Image view: The view is set to type matrix. I basically load a map (indoor floor plan) to this custom view and want to drag, zoom and rotate by multitouch. I succeeded in all that but the problem happened when I rotate...

how to dissable and enable auto rotate on swift?

ios,swift,rotation,auto
On general settings I allow portrait and landscapeleft , landscaperight modes. I want to turn off landscape modes. On viewController I write this code: override func shouldAutorotate() -> Bool { return false } However, the auto rotation works ignoring this function. How to disssable and enable autorotation on swift? IOS...

C - matrix rotation

c,matrix,rotation
I'm writing a program in C and I need a M x N matrix to rotate clockwise. I tried some algorithms, but they only work in N x N matrices. The matrix {(1,4), (2,5), (3,6)} should become {(3,2,1), (6,5,4)}: 1 4 2 5 -> 3 2 1 3 6 6...

How can I rotate a font icon 45 degrees?

css,rotation,icons,icon-fonts
I want to rotate this font icon 45 degrees. The icon has this CSS (all CSS compiled via LESS): [class^="flaticon-"]:before, [class*=" flaticon-"]:before, [class^="flaticon-"]:after, [class*=" flaticon-"]:after { font-family: Flaticon; font-size: 20px; font-style: normal; margin-left: 20px; } And it's this Flaticon: http://www.flaticon.com/free-icon/hand-pointer_70655 I've installed it as an icon font. However, when I...

ShellScript Rotate rectangulous text by 45°

bash,shell,unix,awk,rotation
I need to do a script for bash to solve the word game for 8 directions. I have managed to make some code, but the last thing I am stuck on, is how to rotate the table to find the words in all directions. 90° is not a problem, but...

Applying a “Spread” value to an XMFLOAT4X4

rotation,directx-11,matrix-multiplication,quaternions
I'm attempting to add a small value to a World Matrix in order to replicate the accuracy of a fired weapon [pistol, assault rifle] Currently, my World Matrix resides at a Parent Objects' position, with the ability to rotate about the Y axis exclusively. I've done this in Unity3D, running...

jQuery - Simple Text Rotator with click event

jquery,rotation
I am using Simple Text Rotator and its fantastic, my only issue I have with it is a click event I have is not working with it: $(function() { $('a[href*=#]:not([href=#])').click(function() { if(!$(this).hasClass('carousel-control')){ if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) { var target = $(this.hash); target = target.length...

record video by front-camera - WP8 - C#

windows-phone-8,video,rotation,front-camera
My windows phone app needs to record a video from front-camera and send it to the server through a webservice. Here while I'm trying to record video from front-camera, I'm getting mirror inverted video. Means front-camera records 180 degree rotated video. what i think probably the only solution of it...

JavaFX 8 Transform to pitch, yaw and roll rotation angles

matrix,3d,rotation,javafx-8
Implementing the answer from this thread I have this code that translates the deltayaw, deltaroll and deltapitch angles into one angle and rotates a node around it. The angles that are taken as the parameters are momentary changes of angles since giving the whole angles would ignore the changes in...

Rotate text in SVG

xml,svg,rotation,scale,scaletransform
I got a chart with svg which looks like Now I want to rotate the text like My SVG root is the following <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events" version="1.1" baseProfile="full" viewbox="-75 0 1075 800" transform="translate(0, 750) scale(1, -1)" width="1000" height="800"> </svg> If I try to rotate the text with <text x="-70"...

Rotate animation after Translate doesn't work on Android

android,animation,rotation,translate
I'm trying to implement an app with animations. I want to get this sequence: 1 - Moving a image horizontally 2 - Rotate the image 90º 3 - Move the image vertically But in step 2, the image does not rotate on itself and moves to original position to rotate....

rotating a square in javascript

javascript,canvas,rotation,geometry
I am trying to rotate a square about its center in javascript. Although in this case I am using canvas to draw the square, I need to have a functional method of rotating the square for use elsewhere so just rotating the canvas is not acceptable. This is what I...

Adjusting views when Status Bar hides on rotation

ios,rotation,autolayout,uistatusbar
I've browsed around looking for an answer for this, but I've only found people with similar problems and not this exact problem, so hopefully someone here can help me! I have an iPad App. On iPad, when you hold the iPad in either portrait or landscape, the status bar with...

How to rotate text with view using OpenLayers 3

text,view,rotation,openlayers,openlayers-3
I am developing a navigation application, which draws planned route on a map. Planned route consists of points connected with a line. Each point is labelled with distance and direction. When I initially draw the route on the map, I calculate text position in a way, where it doesn't interfere...

MATLAB: How to make camera light follow 3D Rotation

matlab,user-interface,3d,rotation,lighting
I have come into a problem recently when trying to rotate 3D objects. I am building a GUI and I have a separate figure where an object is plotted. In the figure, I allow the user to use MATLAB's built-in rotate button to move the object around. However, I am...

How do I make a texture rotate to face a Vector2?

c#,rotation,xna
I'm making a game in C# XNA 4.0 and I want the game to have guns that rotate to face the player and shoot at them. I have attached a picture below to summarise this. I have the shooting AI implemented, but I want to know how I can make...

Rotate object around the world axis

javascript,rotation,three.js
I found several different supposedly working ways to rotate an object around the world axis but all of them kept rotating the object around it's own axis instead of rotating it around the world's. So, what's the proper way to rotate an object around the world's axis? If I wasn't...

How to rotate image to its next degree on button click event?

jquery,html,css,rotation,transform
I am playing with jquery.rotate.js and I want to rotate image everytime to next rotation degree. I have included following jquery librarys: <script type='text/javascript' src='http://code.jquery.com/jquery-1.7.1.js'></script> <script type='text/javascript' src='jquery.rotate.1-1.js'></script> jQuery Code: $(window).load(function() { $("body").on("click", "#button", function() { $(".north").rotate(a()); }); nextAngle = 0; function a() { nextAngle += 90; if (nextAngle >=...

SVG circle starting point

javascript,css,svg,rotation,circle
How can I change the starting point of a svg circle for animate it progressively begining at 0 o'clock? the default circle svg begin at 3 o'clock. My current circle ( hover for animation): #timeline{ position:fixed; width:500px; height:500px; top:50%; left:50%; margin-top:-250px; margin-left:-250px; overflow:hidden; pointer-events: all; z-index:99999; } #bluecircle{ stroke-dasharray:1510; stroke-dashoffset:1510;...

Create a formula for velocity based on rotation in 3d?

math,3d,rotation,velocity
So I have a bit of a math problem. Here are the pieces. Input: Rot = Rotation (degrees). This is the rotation of the "player". This is also the yaw. Vel.X = This is the left/rightward movement that would be happening if it weren't rotated Vel.Z = Same as last...

Rotating wheel in android

android,rotation,android-animation,android-imageview
My imageview consists of circle wheel as shown in below pic.I want that wheel should start rotating as soon as user presses a start button and stop rotating when user presses stop button.Is it possible programmatically?If yes,how can i do that? ...

Rotate a grid of points in C++

c++,math,rotation,grid,geometry
If i had an array of point structs defined as struct Point{ float x; float y; }; How would I rotate the points in this array by a given angle? As an example: Any help would be appreciated!...

Screen rotation causes trouble with secuential calls to SQLite

android,sqlite,rotation,restore
If you are an experienced Android programmer, you probably know Screen orientation causes the app to be saved and restored via the onSaveInstanceState() and onRestoreInstanceState. you will probably also know that objects are not easy to restore via those features, for example, if i create a database connection as follows:...

Pause and resume animations except of rotation in iOS?

ios,animation,rotation,core-animation,calayer
If I need simply to pause/resume rotation then I use the following code: - (void)pauseAnimations { CFTimeInterval paused_time = [self.layer convertTime:CACurrentMediaTime() fromLayer:nil]; self.layer.speed = 0.0; self.layer.timeOffset = paused_time; } - (void)resumeAnimations { CFTimeInterval paused_time = [self.layer timeOffset]; self.layer.speed = 1.0f; self.layer.timeOffset = 0.0f; self.layer.beginTime = 0.0f; CFTimeInterval time_since_pause = [self.layer...

Quaternion Rotation Between Two Sets of Vectors

c++,vector,rotation,quaternions
I would like some help on finding the rotation between two sets of two vectors in 3D as a quaternion. In each pair, the vectors would be at right angles to each other and have unit length (basically two vectors in an orthonormal basis). My current code looks something like...

jQuery - Simple Text Rotator with a href links

jquery,rotation
I am using Simple Text Rotator and its fantastic, my only issue I have with it is my text I am trying to rotate are links: <h1 class="sliding-text"> <span class="rotate"> <a href="#link-1">Link 1</a>, <a href="#link-2">Link 2</a>, <a href="link-3.php">Link 3</a>, <a href="link-4.php">Link 4</a> </span> </h1> but when I run my site,...

How to rotate a THREE.PlaneBufferGeometry with THREE.WaterShader and MirrorMesh

rotation,three.js,shader
In this example we have a THREE.PlaneBufferGeometry with WaterShader and Water Normals texture. If you try to delete the rotation at line 119, the plane rotates as expected but the Shader and the normals aren't working correct anymore but they are distorted. How can you rotate without distortion?Is it something...

Smooth camera rotation unity

unity3d,camera,rotation,unityscript
I create third person with camera. The camera will move in sync with the mouse move. I create script for camera move, its work but when the speed is high then everything starts to shake. How force the camera move smooth? Vector3 rotation = new Vector3(); rotation = this.transform.rotation.eulerAngles; float...

Android: start animation from state it ends

android,animation,rotation
So i got this Rotation Animation: rotate = new RotateAnimation(0f, -270f,200,200); rotate.setDuration(2000); rotate.setFillAfter(true); and i have Button that start the animation on click public void click(View view){ Image.startAnimation(rotate); } and when i click on button animation starts correctly and ends on needed state. but when i click second time it...

SFML - Rotating a sprite around its center using a Transform

rotation,sfml
I have an object that needs to be able to be rotated around its center, but keeping the same origin (for setting position, etc). So, I figured I needed to use a Transform. Code is in Java (JSFML), but I figured the syntax was similar and able to be understood...

Controlling/moving an object in a circular motion in Unity

c#,unity3d,rotation,position
Basically, I want it so I can move an object left or right, but in a circular motion, rather than a straight line. This is because the object is the child of another sphere, and I want to move the object around the sphere using the left/right arrowkey so a...

CSS transitions - rotateX is just changing the size of my element

css,rotation,size,2d,transitions
I have a problem with CSS transitions. I have two buttons on my website (here) which are supposed to be pushed back on the bottom of it when the mouse is holding down on it just like on the Windows 8 start menu. Instead, what's happening is is that it...

WPF Rotate an Image and align it

wpf,xaml,rotation,rendertransform
I've an Image component where I want to rotate the source : <Image Name="ImageTarget" HorizontalAlignment="Left" VerticalAlignment="Top" Stretch="Uniform" RenderTransformOrigin=".5,.5"> <Image.RenderTransform> <TransformGroup> <ScaleTransform ScaleX="{Binding Main.BindedViewMode, Converter={StaticResource ImageSizeConverter}}" /> <ScaleTransform ScaleY="{Binding Main.BindedViewMode, Converter={StaticResource ImageSizeConverter}}" /> <RotateTransform Angle="-90" /> </TransformGroup>...

How to let not rotated text follow a rotated div?

html,css3,rotation
I'm having a problem for which I couldn't find a solution. I want to rotate a div element which contains text. The text shouldn't be rotated though, but must be contained in the div. This is how it looks now. Sadly I cannot post an image of how it should...

Rotate Icon 360 degrees clockwise angularjs

javascript,angularjs,rotation
Angular newbie here, I am trying to create a button that will have an icon inside of it rotate 360 degrees once click on. As of now I have the rotate but it rotates the whole button instead of just the element. Looking to just have it rotate the "blue...

White background when rotating a webview

android,webview,rotation
I am trying to "play" with a webView. I slide it and rotate it, and it works fine. The problem is that when I rotate it, I get a ugly white rectangle in the background emcompassing the webview. I tried to change the background color but it's still there, and...

how to rotate an image programmatically in a splashscreen instead of using progressbar?

android,rotation,functional-programming,splash-screen
public class SplashScreen extends Activity { private static int SPLASH_TIME_OUT = 30000; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.splash); new Handler().postDelayed(new Runnable() { @Override public void run() { // This method will be executed once the timer is over // Start your app main activity Intent i = new...

Java ArrayList Adding objects --> Throw out old ones

java,arraylist,rotation
I have a class called "Transaction.java", and I have an ArrayList with the newest five transactions. So the size of this ArrayList should always be between 0 and 5. When there's a new transaction, I have to rotate all the entries in this ArrayList. Entry 4 becomes entry 3, entry...

How to rotate an image R raster

r,plot,rotation,raster
I have code below which saves an image to my pc. I would like to rotate that image by 45,90 and 135 degrees around its center (or bottom left hand corner) and then save as 3 different images. How could I do that? library(raster) r1 <- brick(system.file("external/rlogo.grd", package="raster")) x <-...

Responsive diamond shape with center aligned content using transform rotate

html,css3,rotation,transform,centering
I am having great difficulties trying to create a centered, responsive diamond shape in the center of a 100% x 100% container, with the diamond containing a center aligned logo. Sound confusing? Well, this is what I mean: (images are self-drawn graphics) I have managed to get the responsive diamond...

How to rotate selected QGraphicsItems around the selection center?

qt,rotation,selection,qgraphicsitem
I would like to implement rotation of selected items. I have noticed that there are 2 functions - rotate() which performs an immediate action but does not save the rotation on the item - and setRotation(), which stores rotation() (though it requires a repaint causing event). If I select a...

Rotating all rectangle corners

java,math,rotation,lwjgl
I'm working on a game where you are a spaceship. This spaceship has to be able to rotate. The rectangle has two arrays x[], y[] containing all the corners positions of the rectangle. But when I apply the rotation formula, I get a rather wierd rotation. To try to explain...

Rotate Point3D around Unit Vector, Solved

c#,wpf,rotation,quaternions
as an Image above i want to rotate the point P1 around unit vector RotationAxis (Red vector in Image and its in Center). in my program (WPF) i Have a Quaternion and a 3DPoint. How can i rotate the Point P1? i tried Matrix rotation but it rotates nothing. Matrix3D...

Rotate a basis to align to vector

matlab,matrix,rotation,transform
I have a matrix M of size NxP. Every P columns are orthogonal (M is a basis). I also have a vector V of size N. My objective is to transform the first vector of M into V and to update the others in order to conservate their orthogonality. I...

Difference Between Combining Quaternion Rotations and Rotation Matrices

matrix,rotation,quaternions
Is the result of combining two quaternion rotations the same as that of two matrices and then converting that into a quaternion? I have a quaternion (q1) and rotation matrix (m2) as input for a function (unfortunately non-negotiable) and would like to rotate the initial quaternion by the matrix resulting...

Rotating charts in Chart JS

javascript,canvas,charts,rotation
I have a requirement for a chart that looks as such: I found Chart JS' Polar Area Chart, but it's not rotated as I needed. And since Chart JS doesn't seem to have a rotate property, I tried just rotating the canvas with CSS #myChart { -webkit-transform: rotate(-25.2deg); transform: rotate(-25.2deg);...

How do i return a node to its original position after a rotation transition

java,animation,javafx,rotation
I have a Applied a on mouse entered action listener and a on mouse exited listener to a button.when the mouse hovers over the button, it rotates and on exit its suppose to stop and return to its original position but unfortunately i don't know how to achieve this....any ideas?...

In android toolbar when icon is made rotating using animation it is shifting its position towards left

android,animation,rotation
When i am trying to rotate an icon in toolbar using animation, it starts rotating but it is shifting towards left. Below is the code I used for making the icon start rotating and stop rotating private MenuItem refreshItem; private Animation animRotate; private ImageButton imgRotate; refreshItem = menu.findItem(R.id.action_btn_refresh); public void...

Rotate rectangle with 4 points using Angular

javascript,angularjs,d3.js,rotation
I have a rectangle that drawn with 4 points. I need to rotate all points an arbitrary degree and find the new x,y of the points.I try to rotate these but the problem is when I'll increase the degree, rectangle Becomes smaller and when I'll decrease the degree, the first...

Custom C++ Quaternion Rotation Not Working Correctly

c++,rotation,vector-graphics,quaternions
In my code, I have a quaternion that is used for rotation for a camera for the player. Rotation itself seems to work fine, but my directional vectors for moving and to rotate on do not rotate correctly. Quaternion Multiplication: Quaternion Quaternion::operator*(Vector3 other) const { float x_ = w *...

Set rotation point of Rectangle

qt,rotation,qml,qtquick2,qt-quick
Is there a way to set rotation point in Rectangle and simply use rotation property without any other additional component? I want to rotate a Rectangle with binding property of rotation: value * 180 like this Rectangle{ id: body rotation: value anchors.centerIn: parent.Center antialiasing: true } onValueChanged: body.rotation = value...

Menu item animation, rotate indefinitely its custom icon

android,animation,menu,rotation,menuitem
I have a menu item with an icon (imagine for example a clock with a single lancet), I would like to make its icon rotate indefinitely. How could I manage this effect? Thank you....

Control sprite rotation (it's spinning like crazy)

java,android,rotation,libgdx
So, I have created a texture, and then a sprite. On my render() method, I am check for user input. If the user has touched/clicked, then I want my sprite to rotate 90 degrees ONCE. Right now the rotation works. However, it rotates multiple times per click! How can I...

Is it possible to rotate a vector in 3D space using quaternions only?

c++,rotation
I want to rotate a vector in 3D space around the origin. Let's say I have a hypothetical polygon centered around the origin, and laying perpendicular to the y-axis. I then want to rotate this polygon around some arbitrary axis by some arbitrary rotation amount. Example: Rotate around the Y...

transform-origin not working on firefox

css,css3,firefox,svg,rotation
I'm trying to make this effect on Firefox but "transfrom-origin' is not working properly, and the result on Firefox it looks way different. I want to imitate the waving effect and its working perfectly in Chrome and Opera and also Vivaldi as for IE i don't really care! Thanks .arm-wave...

I imrotate() an image, draw two lines, rotate back the lines and draw them in orginal image, but don't get the expected result in MATLAB?

matlab,rotation,translation,image-rotation
What I want to do : Suppose I have an image I that I rotate -45° using imrotate (I get I_R). Then I draw two lines AB and CD (parallels). Finally, I rotate the two lines back (45°) and draw them in the original image I. How I do that...

Reversing RotateAxisAngle back to angles

c++,matrix,rotation,geometry,axis
I'm trying to figure out how to reverse RotateAxisAngle to get back rotations around these arbitrary axes (or equivalent rotations that yield same net rotation, doesn't have to be identical). Does anyone know how to do it? I'm using MathGeoLib, but I don't see an opposite way, to return back...

CSS3 onclick rotate and scale

javascript,jquery,css,css3,rotation
I created a simple effect that rotates an image on click using CSS and jQuery. So far, so good, but when the image is wider I want to keep it within the parent div (sort of scaling it along with the rotation). Here's a fiddle to clarify my question: http://jsfiddle.net/52pxbfcs/2/...

What are the calculations behind the properties in a re-rotated element?

css3,math,rotation
I have been playing around with an idea of a contact card type of thing. Apparently hexagons are quite a new trend, but I'd like to keep it a tad simpler, namely: rotated squares. Considering I am quite knowledgeable with HTML and CSS, it wasn't that hard to accomplish this....

ITextSharp rotate all text on a page about a point

.net,pdf,rotation,itextsharp,affinetransform
I've just burnt an hour working out a solution to this, which I'm sure isn't the best one; I'd be happy to hear if there is a better solution. I need to rotate all text on a page about a point. I've tried transforming the point to the origin, performing...

WKWebView added as Subview is not resized on rotation in Swift

ios,swift,rotation,addsubview,wkwebview
I'm working on adding a new reading view to my browser app. It is another view controller, that only includes a WKWebView added as a subview with a button (and gesture) to close the view. Everything works great, but when I rotate the device, the subview isn't resized, so I...

How to rotate the contents of 16x16 bitmap array using only maths (no scaling, just clip the corners off)

c++,bitmap,rotation
another question from me about bitmaps! A quick intro to this: I'm working on a university project where I have no external libraries, only the basic windows/c++, this bitmap rotation must be done entirely by simply modifying pixels in an array. I have a 16x16 bitmap (it's just a COLORREF...

Rotating object along all 3 axes to map to the player's camera LookAt vector

opengl,math,rotation
I have a simple 3D LookAt vector, and I wish to rotate the player model (a simple cube) to show where the player/cube is looking at. For sideways camera movement I've managed to figure it out and do the following: glTranslatef(position.x, position.y, position.z); glRotatef(atan2(lookAt.z, lookAt.x) * 180 / PI, 0,...

Getting the difference between two mirrored rotations in Unity

unity3d,rotation
I have two example objects in Unity structured as follows: EmptyGameObject1: scale(-1, 1, 1) - Child1: rotation(-4, 167, 179) EmptyGameObject2: scale(1, -1, -1) - Child2: rotation(-1, -10, 0) Now I want to get the difference between the euler angles of the childs considering the scale of its parent. Vector3.Distance returns...

Objects rotating around another object keep accelerating

c++,rotation,sfml
Ok so I'm still new to programming and I've been trying to work on a scene graph and whenever I rotate an object its children keep accelerating around it when all I want them to do is rotate around the parent object at the same speed it (the parent object)...

How can I detect rotation angle between 2 images in C#?

c#,image,winforms,image-processing,rotation
I have 2 images, one is the original image which has grids in it, the other is the same image except it has digits written in those grids, and is rotated, I am supposed to find the rotation angle for that image so that I can make it straight and...

Why do I get a different number in the inspector than the actual value?

unity3d,rotation
I was trying to rotate the directionLight of the skybox using a simple script. However, I had a weird glitch where I wanted to make it so that if the directionLight was above a certain degree, it would shut off. In the inspector, it said that the rotation was well...

CSS rotate animation with pulse

html,css,animation,rotation,frontend
I am trying to make an animation using CSS. It should rotate an image and give it a pulse (something similar to Shazam's button animation). The following is my code. Image is rotating but if I add 'scale' to try and make it pulsate as well, it has a pulse...

Rephrase spirograph code into function

python,function,python-2.7,tkinter,rotation
I'm writing a python spirograph program, and I need some help with converting part of it into a function. The code is attempting to reproduce the result illustrated in the video I found here. One line rotates around the origin, and then another rotates off the end of that, etc....

change up movement depending on rotation

javascript,canvas,rotation
This question is related to How to rotate a canvas box using keyboard? If you read the question, you know that I'm trying to make a box rotate with the keyboard. The box can as well move left, up, right and down. And my most current version can also turn....

Android Rotation Animation

android,rotation
I have a triangle that I want to have rotate 120 degrees every time the user clicks on the screen. I have three rotate animations that go from 0-120, 120-240, and 240-360 degrees. Rotate 1: <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/linear_interpolator" android:fillAfter="true"> <rotate android:duration="500" android:pivotX="50%" android:pivotY="50%" android:repeatCount="0" android:startOffset="0" android:fromDegrees="0"...