rotation

Android Rotate Surface created using MediaCodec

一笑奈何 提交于 2019-12-23 04:51:29
问题 I am using Camera2 APIs to capture video from the Camera. I understand that we need to rotate the preview as Camera2 does not have an equivalent of setDisplayOrientation(). Able to rotate preview using a Matrix. I am also using the MediaCodec APIs to encode the video. The encoded video however is inverted when I rotate the phone 180 degrees. I am out of ideas on how to rotate the encoded video. I tried KEY_ROTATION in MediaFormat while configuring. But I guess this is only while decoding

QGraphicsSvgItem positioning after rotation

ぐ巨炮叔叔 提交于 2019-12-23 04:45:25
问题 I encountered a strange issue/feature when I try to rotate a QGraphicsSvgItem object and set a position. Check the following example: I have one .svg for the sake of simplicity that is a blue rectangle. I create two QGraphicsSvgItem using the file and I rotate on of them with 90 degree. I set both of them to the same position, however the rotated one positioned 'wrongly'(maybe that is the correct behaviour). It looks like that the x,y coordinate(top-left corner) is now the top-right corner,

First person camera doing front- and back-flips in C#

假装没事ソ 提交于 2019-12-23 04:34:16
问题 I'm trying to get a first person camera to have a maximum up-angle and down-angle, so that it doesn't do front- and back-flips when looking to far up or down. For some reason, the Mathf.Clamp doesn't keep my x-rotation fixed. Any ideas as to what I can do about this issue? float rotLeftRight = Input.GetAxis("Mouse X"); float rotUpDown = Input.GetAxis("Mouse Y"); Mathf.Clamp(transform.rotation.x, -60, 60); rigidbody.AddTorque(rotUpDown*mouseSensitivity, rotLeftRight*mouseSensitivity, 0); I'm

First person camera doing front- and back-flips in C#

筅森魡賤 提交于 2019-12-23 04:34:13
问题 I'm trying to get a first person camera to have a maximum up-angle and down-angle, so that it doesn't do front- and back-flips when looking to far up or down. For some reason, the Mathf.Clamp doesn't keep my x-rotation fixed. Any ideas as to what I can do about this issue? float rotLeftRight = Input.GetAxis("Mouse X"); float rotUpDown = Input.GetAxis("Mouse Y"); Mathf.Clamp(transform.rotation.x, -60, 60); rigidbody.AddTorque(rotUpDown*mouseSensitivity, rotLeftRight*mouseSensitivity, 0); I'm

Writing a program in which there's a picture rotating around a circle

拈花ヽ惹草 提交于 2019-12-23 04:04:28
问题 These days I'm trying to write a computer game. In a part of my game, there's a picture of enemy rotating around a circle. I mean, it rotates but not correctly. In my program, the enemy must move forward on pixel after each 500 milliseconds. But after each 500 milliseconds, it appears at a random point of the circle. I don't know what the problem is. Here is my code: <HTML> <HEAD> <TITLE></TITLE> <META NAME="GENERATOR" Content="Microsoft Visual Studio"> <META HTTP-EQUIV="Content-Type" content

how to detect which side of 3d cube was clicked?

删除回忆录丶 提交于 2019-12-23 04:04:21
问题 I am writing a small 3d "engine" in canvas.. not really an engine, but more of an application based on code from Eric Pascarello's demo (hit number "7" a few times to see it rotating) it's all going very nice, I even added sorting by average z-value for each plane ("side") - so that I can use a body made of several cubes so that close to camera shapes are drawn last. now, I want to detect which side was clicked, when a mouse clickes the canvas. something like this hints: each side is defined

Rotated image coordinates after scipy.ndimage.interpolation.rotate?

烂漫一生 提交于 2019-12-23 03:49:06
问题 I have a numpy array for an image that I read in from a FITS file. I rotated it by N degrees using scipy.ndimage.interpolation.rotate . Then I want to figure out where some point (x,y) in the original non-rotated frame ends up in the rotated image -- i.e., what are the rotated frame coordinates (x',y')? This should be a very simple rotation matrix problem but if I do the usual mathematical or programming based rotation equations, the new (x',y') do not end up where they originally were. I

Canvas, animated text rotation

半城伤御伤魂 提交于 2019-12-23 03:18:49
问题 I want to have a animated canvas rotation of a word, while another word on the canvas does not move. But somehow both stand still. What do I have to change? [link]http://jsfiddle.net/2dszD/8/ var canvas; var ctx; var canvasWidth; var canvasHeight; var interval = 10; function init(){ canvas = document.getElementById("canvas"); ctx = canvas.getContext('2d'); canvasWidth = canvas.width; canvasHeight = canvas.height; setInterval(redraw, interval); } init(); function redraw() { ctx.clearRect(0, 0,

How to find angle formed by the blades of a wind turbine with respect to a horizontal imaginary axis?

此生再无相见时 提交于 2019-12-23 02:42:28
问题 An ideal Wind Energy Farm will have all the turbines rotating with the same Blade Angle*, in a similar fashion. The blades of different turbines spin at variable speeds. As a result of this, the Blade Angle for every Wind Turbine is different. Considering a case of 4 Wind Turbines, each placed a 100 meter apart and forming a Blade Angle of ө1, ө2, ө3 and ө4, we can use OpenCV to monitor the Blade angles of each turbine by using suitable computer vision algorithms and by taking into account

Mapping outside quaternions to Unity

妖精的绣舞 提交于 2019-12-23 02:36:57
问题 I'm trying to map rotations from a sensor into Unity using Quaternions, and I cannot seem to figure out why rotations do not map correctly. I'm using the Adafruit BNO055 to pull absolute orientation in the form of Quaternions. The source for their Quaternion implementation can be found here. From what I understand about Quaternions, which is almost nothing, I should be able to pull a Quaternion out of the sensor and pump it into any GameObject inside Unity so that they share the same