rotation

OpenCV : wrapPerspective on whole image

妖精的绣舞 提交于 2021-02-07 07:12:02
问题 I'm detecting markers on images captured by my iPad. Because of that I want to calculate translations and rotations between them, I want to change change perspective on images these image, so it would look like I'm capturing them directly above markers. Right now I'm using points2D.push_back(cv::Point2f(0, 0)); points2D.push_back(cv::Point2f(50, 0)); points2D.push_back(cv::Point2f(50, 50)); points2D.push_back(cv::Point2f(0, 50)); Mat perspectiveMat = cv::getPerspectiveTransform(points2D,

Mouse position within rotated rectangle in HTML5 Canvas

大兔子大兔子 提交于 2021-02-07 03:57:32
问题 Rotation of rectangles within an html5 canvas is being stored in radians. In order to find whether subsequent mouse clicks are within any given rectangle, I am translating the mouse x and y to the origin of rotation for the rectangle, applying the reverse of the rotation to the mouse coordinates, and then translating the mouse coordinates back. This simply isn't working - mouse coordinates are not being transformed as expected (that is, not within the bounds of the original rectangle when

Mouse position within rotated rectangle in HTML5 Canvas

早过忘川 提交于 2021-02-07 03:57:18
问题 Rotation of rectangles within an html5 canvas is being stored in radians. In order to find whether subsequent mouse clicks are within any given rectangle, I am translating the mouse x and y to the origin of rotation for the rectangle, applying the reverse of the rotation to the mouse coordinates, and then translating the mouse coordinates back. This simply isn't working - mouse coordinates are not being transformed as expected (that is, not within the bounds of the original rectangle when

How to specify the x-y rotation point when using animateTransform?

我是研究僧i 提交于 2021-02-07 01:41:36
问题 I want to use animateTransform to rotate an SVG image continuously. So here we go: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1024px" height="768px" enable-background="new 0 0 100 100" xml:space="preserve"> <g transform="translate(100, 100)"> <rect fill="#FE9FFF" width

How to specify the x-y rotation point when using animateTransform?

若如初见. 提交于 2021-02-07 01:40:06
问题 I want to use animateTransform to rotate an SVG image continuously. So here we go: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1024px" height="768px" enable-background="new 0 0 100 100" xml:space="preserve"> <g transform="translate(100, 100)"> <rect fill="#FE9FFF" width

UIView flip vertically

和自甴很熟 提交于 2021-02-06 15:10:52
问题 I know it's probably a dummy question, but I have to ask: How to flip a UIView vertically? I'm not asking for doing a animation, but just flip it. I can do vertical flip a UILabel by: label1.layer.transform = CATransform3DMakeRotation(M_PI, 1.0f, 0.0f, 0.0f); and turn it back by: label1.layer.transform = CATransform3DMakeRotation(M_PI, 0.0f, 0.0f, 0.0f); But when I'm doing it to a view: self.view.layer.transform = CATransform3DMakeRotation(M_PI, 1.0f, 0.0f, 0.0f); I think it only rotate half

setRotation of TextView in RemoteViews (app widget)

早过忘川 提交于 2021-02-05 09:38:29
问题 I have a widget whose xml layout is simple: an ImageView and a TextView . I can hardcode the rotation of the TextView in the xml by using android:rotation . However I want to be able to set the rotation of the TextView programmatically. It seems that a View has a setRotation() method, so the TextView will inherit this method, such that a "normal" TextView can be rotated programmatically used this method. But when the TextView is buried within a RemoteViews , you have to call the methods

Pygame- rotate sprite and follow path simultaneously [duplicate]

别说谁变了你拦得住时间么 提交于 2021-02-05 06:42:25
问题 This question already has answers here : How do I rotate an image around its center using Pygame? (6 answers) Closed 4 months ago . I'm trying to animate a ball getting thrown, and I want it to rotate an follow a smooth, parabolic path at the same time. However, I just can't seem to get pygame.transform.rotate() to cooperate. Here's what I've tried so far: import pygame screen = pygame.display.set_mode((500, 500)) timer = pygame.time.Clock() ball = pygame.sprite.Sprite() ball.image = pygame

WebGL FPS camera movement along the local axis instead of the world axis with glMatrix.js

落花浮王杯 提交于 2021-01-29 15:21:40
问题 I'm trying to make a FPS camera in WebGL. When I move the camera from the initial position and then rotate, the camera moves along the start position instead of the new position. The translation and rotation are made with glMatrix.js library. I have the variables: var rotateY = 0; // For rotating along the Y axis var fronBackMovement = 0; // Front and back movement var sideMovement = 0; // Movement from side to side Keyboard events: // Movement if( key.w == true ){ fronBackMovement += 5; } if

How to Lerp a rotation the shortest path

混江龙づ霸主 提交于 2021-01-29 08:22:59
问题 I have a tank, which is made of a base and turret on top, both separate but under a parent object. To shoot, the turret will rotate to the shooting direction, then lerp back towards the tanks base rotation. I want to rotate the turret in the shortest possible direction. So if the base is at 0 degrees and the turret is at 270, I change the 270 to -90 and it will lerp from -90 to 0, however if the base is at 180 and the turret is at 270, it needs to lerp from 270 to 180, not from -90. This is