rotation

Rotate Leaflet markers tooltip text

梦想的初衷 提交于 2020-01-06 08:10:22
问题 I have some JSON with data that should be shown on the map. var shapesCoordinates = '[{"shapeId": 1,"coordinates": [-1500,500],"text": "bla bla", "rotation": 20},{"shapeId": 2,"coordinates": [-1800,800],"text": "idemooooo", "rotation": 60}]'; var shapess = JSON.parse(shapesCoordinates); var markers = []; for (var i = 0; i < shapess.length; i++) { var marker = L.marker(shapess[i]['coordinates'], { opacity: 0.01 }).bindTooltip(shapess[i]['text'], { permanent: true, className: "shapesText",

On rotation cell height gets lost on iOS 8 when using auto layout

荒凉一梦 提交于 2020-01-06 07:14:53
问题 Normally iOS 8 should be able to calculate the height of a cell itself. This is working so far, but if I rotate the device the cell gets back to its standard height of 44 points. This is how it should look like: This is how it does look like after rotation: Once rotated it stays in that layout. It never calculates the real height anymore. I don't know why. I have added my complete code. For the constraints have a look into updateConstraints . The code is in C# but you should be able to read

Scenekit - convertTransform of a rotated sub-subNode based on world axes

爱⌒轻易说出口 提交于 2020-01-06 06:08:58
问题 I have a following scene: [Root Node] | [Main Container] | | [Node A Wrapper] [Node B Wrapper] | | [Node A] [Node B] I've set up pan gesture recognizers in a way that when u pan in open space, the [Main Container] rotates in the selected direction by +/- Double.pi/2 (90deg). When the pan starts on one of the subnodes A, B (i'm hittesting for this on touchesBegan), i want to rotate the subnode along the direction of world axis (again 90deg increments). I'm rotating the [Main Container] using

Rotating a 3d polygon into xy-plane while maintaining orientation

我的未来我决定 提交于 2020-01-06 04:00:08
问题 I have a polygon oriented any way and positioned anywhere in 3d space. I need to transform the polygon into the xy-plane so that I can perform various operations on it (in particular generating a grid of points across the bounding box of the polygon) in 2d rather than 3d, then transform it back. The problem comes with the orientation of the transformed polygon. If I just wanted to rotate into the plane, I could take the angle between the polygon's normal and the xy-plane and rotate around an

How to resolve this rotation problem?

浪尽此生 提交于 2020-01-06 03:47:07
问题 For sure this is very trivial math stuff for some of you. But: When I rotate a view, lets say starting at 0 degrees and rotating forward 0.1, 1, 10, 100, 150, 160, 170, 179, 179,999, and keeping on rotating in the same direction, this happens, to say it loud and clear: BANG !!!! BAAAAAAAAANNNNNGGGG!!!! -179,9999, -170, -150, -50, 0, 50, 100, 170, 179,99, and again: BBBBAAAANNNGGG!!! -179,999, -170, -100, and so on... for sure you know what I mean ;-) Imagine you driving on a road and suddenly

Rotating a 4x4 Matrix Causes Scaling Over Time

无人久伴 提交于 2020-01-06 03:26:11
问题 I am using glm::rotate to rotate a transformation matrix for a cube in a scene. "cube->t = glm::rotate(cube->t, stepTime * 50.f, glm::vec3(0.f, 1.f, 0.f));" is called once per frame, where cube->t is the matrix in question. The strange thing is that over the course of 20 minutes (or two minutes if I rotate by stepTime * 5000.f instead of stepTime * 50.f ), the cube scales noticeably on the X and Z axes, where the scaling on those two axes is the same at all times (the height of the cube never

UINavigationController + shouldAutoRotate + no subclassing

吃可爱长大的小学妹 提交于 2020-01-05 21:04:50
问题 I have a navigation driven app. I need that app to rotate. The UINavigationController is the root controller/view in the window. I know (and have experienced why) it is a no-no to subclass UINavigationController. I know all i have to do is insert: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; } into the UINavigationController and it will rotate fine. So my question is: how do I enable rotation on the root view controller

Rotating a vector around an axis with quaternion

这一生的挚爱 提交于 2020-01-05 11:27:05
问题 I am trying to learn 3d programming, and right now I am trying to understand how to use quaternions to rotate a vector around an axis. As far as I understand, to rotate a vector v around an axis a, after converting both vectors to quaternions, we multiply v by a, then the product by the conjugate of a. I want to rotate v(0,1,0) around a(1,0,0) by 90 degrees, and I should get a resulting vector v(0,0,1) (or 0,0,-1, depending on the direction of the rotation). I am not getting the output I am

How To Get A Perfect Position Of Rotating View?

百般思念 提交于 2020-01-05 10:12:32
问题 I am have one view and I am rotating that view using CABasicAnimation . Now my problem is that how I get a perfect position of that view while rotating. I have tried many type of codes but i can't got a perfect position during rotation of that view. CABasicAnimation *rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"]; NSNumber *currentAngle = [CircleView.layer.presentationLayer valueForKeyPath:@"transform.rotation"]; rotationAnimation.fromValue = currentAngle;

Keeping text horizontal while it's position is rotating with d3.js

北城余情 提交于 2020-01-05 09:46:34
问题 I'm trying to add labels to the planets around the sun into this example : http://bl.ocks.org/djvanderlaan/4953593. So far, I've managed to add the labels, but the orientation of the labels is rotating with their position, while I want to keep them horizontal for the comfort of the readers. I've been finding a beginning of a solution to my problem here : how to keep text orientation unchanged during rotation in SVG but it's seems very complicated to me (I am a newbie and really not good at