rotational-matrices

C# rotation (transformation) issue

会有一股神秘感。 提交于 2019-12-11 05:38:42
问题 I'm trying to create program where will be List of fishes drawn on the canvas. (Next step will be changing the place of fishes based on some calculation) Each fish is represented by bitmap (png file 7x12 px with picture of fish). I created Form on which is PictureBox which is my drawing canvas. It has size 640x480 px. In code below is simplified code I use (I cutted off all not necesary stuff). My problem is with tranformation matrix, at the moment only with rotation. Problem is in class Fish

Rotation order for eulers getPitch(), getRoll(), getYaw() from Quaternion in libgdx?

柔情痞子 提交于 2019-12-11 03:41:10
问题 When transforming a quaternion to Euler Angles, usually there has to be a order in which the axes are rotated, like in this visualization. How does it work for libgdx? The Quaternion class has the functions getRoll(): Math.asin(MathUtils.clamp(2f * (w*x - z * y), -1f, 1f)) : (float)pole * MathUtils.PI * 0.5f;` getPitch(): Math.asin(MathUtils.clamp(2f * (w*x - z * y), -1f, 1f)) : (float)pole * MathUtils.PI * 0.5f;` getYaw(): ` MathUtils.atan2(2f * (y * w + x * z), 1f - 2f * (y * y + x * x)) :

Compose two rotations in D3 geo projection?

我怕爱的太早我们不能终老 提交于 2019-12-10 11:28:29
问题 Having fun with D3 geo orthographic projection to build an interactive globe, based on all the great examples I found. You can see my simple mockup at http://bl.ocks.org/patricksurry/5721459 I want the user to manipulate the globe like a trackball (http://www.opengl.org/wiki/Trackball). I started with one of Mike's examples (http://mbostock.github.io/d3/talk/20111018/azimuthal.html), and improved slightly to use canvas coordinates and express the mouse locations in 'trackball coordinates' (i

Rotation matrix to euler angles

别说谁变了你拦得住时间么 提交于 2019-12-08 13:07:34
问题 I use the following code to convert a 3X3 rotation matrix to angles : (_r = double[9] ) double angleZ=atan2(_r[3], _r[4])* (float) (180.0 / CV_PI); double angleX=180-asin(-1*_r[5])* (float) (180.0 / CV_PI); double angleY=180-atan2(_r[2],_r[8])* (float) (180.0 / CV_PI); here is a little helper _r[0] _r[1] _r[2] _r[3] _r[4] _r[5] _r[6] _r[7] _r[8] does this make any sense ? cause the angles seem too... interdependent ? x y z all react to single pose change... the rotation matrix is received

Different between rotating the camera vs rotating the scene point (only the point, not the entire scene)?

有些话、适合烂在心里 提交于 2019-12-08 05:33:49
问题 I think rotating the camera and taking the photo of a scene would yield the same result with keeping the camera stable and rotating the scene in reverse way. Assume that the original camera rotation matrix is R1. Rotating the camera means that we apply another rotation matrix R12 (so R2=R12*R1 is the new rotation matrix). Assume that X is the realworld coordinate of scene point. Rotating the scene point in the reverse way means that we apply the reverse rotation matrix R12^-1 to X (this might

Matlab calculate 3D similarity transformation. fitgeotrans for 3D

雨燕双飞 提交于 2019-12-06 15:27:51
How can I calculate in MatLab similarity transformation between 4 points in 3D? I can calculate transform matrix from T*X = Xp , but it will give me affine matrix due to small errors in points coordinates. How can I fit that matrix to similarity one? I need something like fitgeotrans , but in 3D Thanks The answer by @rayryeng is correct, given that you have a set of up to 3 points in a 3-dimensional space. If you need to transform m points in n-dimensional space ( m>n ), then you first need to add m-n coordinates to these m points such that they exist in m-dimensional space (i.e. the a matrix

Principal component analysis with EQUAMAX rotation in R

喜欢而已 提交于 2019-12-06 13:15:06
问题 I need to do a principal component analysis ( PCA ) with EQUAMAX-rotation in R . Unfortunately the function "principal()" I use normally for PCA does not offer this kind of rotation. I could find out that it may be possible somehow with the package GPArotation but I could not yet figure out how to use this in the PCA . Maybe someone can give an example on how to do an equamax-rotation PCA ? Or is there a function for PCA in another package that offers the use of equamax-rotation directly?

Compute rate of change of orientation(angular measurement) along y axis?

安稳与你 提交于 2019-12-06 06:14:24
I want to compute rate of change of orientation of the iPhone along y axis. 1. Initially i need to define the reference as y axis, 2. Then measure the rate of change of orientation(angular measurement) from the defined reference. Does CMAttitude provides a reliable angular measurements to implement this? Or Can i use rotational matrix or integrate gyroscope data(I implement this method, but it's not going to work due to the drift of the gyroscope). So please suggest me a reliable method to get this done? Thank you in advance! First, just to clarify: Rotation rates are not measured "from" any

Compose two rotations in D3 geo projection?

 ̄綄美尐妖づ 提交于 2019-12-06 05:58:05
Having fun with D3 geo orthographic projection to build an interactive globe, based on all the great examples I found. You can see my simple mockup at http://bl.ocks.org/patricksurry/5721459 I want the user to manipulate the globe like a trackball ( http://www.opengl.org/wiki/Trackball ). I started with one of Mike's examples ( http://mbostock.github.io/d3/talk/20111018/azimuthal.html ), and improved slightly to use canvas coordinates and express the mouse locations in 'trackball coordinates' (i.e. rotation around canvas horizontal and vertical axes) so that a fixed mouse movement gives more

LWJGL - Problems implementing 'roll' in a 6DOF Camera using quaternions and a translation matrix

限于喜欢 提交于 2019-12-04 08:39:25
I've spent a couple weeks on this issue and can't seem to find a proper solution and need some advice. I'm working on creating a Camera class using LWJGL/Java, and am using Quaternions to handle bearing (yaw), pitch and roll rotations. I'd like this camera to handle all 6 degrees of movement in 3D space, and roll. Bearing, Pitch and Roll are all quaternions. I multiply them into a 'change' quaternion, and create a translation matrix from that. I put that in a float buffer, and multiply the modelview matrix by my buffer containing the rotation matrix. I can get the bearing and pitch rotations