rotation

Arcball Rotation at 90 degrees

血红的双手。 提交于 2019-12-22 00:37:31
问题 I have successfully implemented Arcball rotation through quaternions, but am confused at what to do when the direction vector of the camera is parallel to up vector. Currently I am just restricting the rotation along the x-axis (the pitch) when the dot product of the direction vector and the up vector exceeds 0.99. In Maya (or Max, XSI where arcball rotation is used) for example, you can rotate around in a full circle very smoothly. I am hoping for a solution similar to that of Maya's

Rotate image around x, y, z axis in OpenCV

三世轮回 提交于 2019-12-22 00:19:58
问题 I need to calculate a warp matrix in OpenCV, representing the rotation around a given axis. Around Z axis -> straightforward: I use the standard rotation matrix [cos(a) -sin(a) 0] [sin(a) cos(a) 0] [ 0 0 1] This is not so obvious for other rotations, so I tried building a homography, as explained on Wikipedia: H = R - t n^T / d I tried with a simple rotation around the X axis, and assuming the distance between the camera and the image is twice the image height. R is the standard rotation

jQuery rotate div onclick +/-90

耗尽温柔 提交于 2019-12-21 22:44:45
问题 I was wondering if there is an easy way to rotate a div +90 degrees after clicking it and by clicking it next time it returns to 0 degrees (so that the div rotates -90 degrees). Since I couldn't find anything I was looking for your help. Thanks. 回答1: You could use toggleClass and apply css transform to that class: $('#rotate').click(function(){ $(this).toggleClass('rotated'); }); fiddle .rotated { -webkit-transform: rotate(90deg); -moz-transform: rotate(90deg); -o-transform: rotate(90deg);

How to rotate sprite in sprite kit with swift

本小妞迷上赌 提交于 2019-12-21 22:20:57
问题 Hi my problem is regarding the rotation of two sprites. When I touch the right half of the screen the rotation starts and moving sprite2 and sprite3. If I touch the left half of the screen the rotation stops because velocity-velocity = 0. If I touch the left half again the rotation begins. However, if I touch the half of the screen corresponding with the current rotational-direction the velocity is duplicated. I want to be able to change the direction of the rotation, but for the speed to

Quaternion from Tait-Bryan angles

孤街醉人 提交于 2019-12-21 20:27:24
问题 I am writing a camera with SharpDX and rotate it with the help of a quaternion. The camera rotation is set with pitch (X rotation), yaw (Y rotation) and roll (Z rotation), so called "Tiat-Bryan" angles (these are not Euler angles which would have an XYX rotation, and not XYZ). I am using a left-handed coordinate system: X+ is rightwards, Y+ is upwards, Z+ is downwards the screen. If I rotate around X ("pitching"), positive values make the camera look downwards. If I rotate around Y ("yawing")

Rotate a node using pan gesture in SceneKit iOS

北战南征 提交于 2019-12-21 20:21:53
问题 I am using the below code to rotate a node using the pan gesture. I like to rotate my node only in the y-axis. let translation = gestureRecognize.translation(in: gestureRecognize.view!) let x = Float(translation.x) let y = Float(-translation.y) let anglePan = (sqrt(pow(x,2)+pow(y,2)))*(Float)(Double.pi)/180.0 var rotationVector = SCNVector4() rotationVector.x = 0.0 rotationVector.y = x rotationVector.z = 0.0 rotationVector.w = anglePan node.rotation = rotationVector if(gestureRecognize.state

three.js rotate camera in plane

倖福魔咒の 提交于 2019-12-21 20:01:31
问题 I have a camera in my app: camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 ); camera.position.z = 1; camera.position.y = -5; camera.rotateOnAxis(new THREE.Vector3(1, 0, 0), degInRad(90)); camera.up = new THREE.Vector3(0, 0, 1); Those code in render function must rotate the camera while I'm pressing the keys: if (leftPressed) { camera.rotateOnAxis((new THREE.Vector3(0, 1, 0)).normalize(), degInRad(1)); } else if (rightPressed) { camera.rotateOnAxis(

Strange overlapping bug between navigation and status bars when rotating fullscreen videos in iPad

强颜欢笑 提交于 2019-12-21 19:59:03
问题 I'm implementing a video player inside my application and strange things happen when rotating the iPad when the video player is working in full screen. My test case is kind of easy: 1.- I set orientation to Vertical 2.- I start video playing (non full screen) 3.- I set full screen 4.- I rotate the iPad while in fullscreen and set it to horizontal 5.- I go back to "non full screen" 6.- Navigation and status bar become overlapped overlapped in a very silly way. Look: 7.- Then I rotate the iPad

Quaternion rotation in XNA

青春壹個敷衍的年華 提交于 2019-12-21 19:18:31
问题 Am I doing the following right? Well obviously not cause otherwise I wont be posting a question here, but I'm trying to do a Quaternion rotation of a model around another model. Lets say I have a box model that has a vector3 position and a float rotation angle. I also have a frustum shaped model that is pointing towards the box model, with its position lets say 50 units from the box model. The frustum also has a vector3 position and a Quaternion rotation. In scenario 1, the box and frustum

Supporting Universal App with Portrait Orientation on iPhone and Landscape+Portrait on iPad

天涯浪子 提交于 2019-12-21 16:56:28
问题 I need my app to be compatible both on iPad and iPhone. Its having a tabbarController as the rootViewController. In iPad I need it to be available both on Landscape and Portrait. In iPhone though I need the rootView to be Portrait itself and i do have some viewsControllers, which are being presented on the tabbarController, which need to be available both in landscape and Portrait (e.g. a viewController used to play videos from Youtube). So I am locking the rotation of the tabbarController as