rotation

Three.js - Rotating a sphere around a certain axis

一世执手 提交于 2019-12-30 01:58:29
问题 I have a problem. In Three.js, I want to rotate a sphere (Earth) around axis tilted by 23.5 degs. I found sphere.rotation.x, sphere.rotation.y and sphere.rotation.z, but when I combine them in the correct ratio, the sphere's rotation is quite weird - it has no permanent rotation axis. I think I need a function like sphere.rotation.vector(1,0,-1). Does anyone know how this function is called and how the correct syntax is? Many thanks for answers! 回答1: You need to use quaternions for this. This

How does this Quaternion rotation code work?

為{幸葍}努か 提交于 2019-12-30 01:31:07
问题 I'm trying to understand how the quaternion rotations work, I found this mini tutorial http://www.julapy.com/blog/2008/12/22/quaternion-rotation/ but He makes some assumptions that I can't workout, like how can I do " work out the rotation vectors around each axis, simply by rotating the vector around an axis. " and how does he calculate angleDegreesX, angleDegreesY and angleDegreesZ? Can some one provide a working example or explanation? 回答1: The shortest possible summary is that a

iOS 6 auto rotate confusion

纵饮孤独 提交于 2019-12-30 01:31:07
问题 I have my entire interface in one Storyboard. How can I make most of the ViewControllers only support a portrait orientation while only a couple supporting all orientations. I can't understand apples new auto rotate system. Also, how can I make this backwards compatable to iOS 5? 回答1: In your Navigation Controller subclass, forward the decision to the top view controller in the stack: -(NSUInteger) supportedInterfaceOrientations { return [self.topViewController supportedInterfaceOrientations]

How to rotate JXImagePanel?

非 Y 不嫁゛ 提交于 2019-12-29 09:29:06
问题 I would to rotate JXImagePanel. It should be possible - this is about JXImagePanel : Swing :: JXImagePanel While JLabel and JButton allow you to easily add images to your Swing applications, the JXImagePanel makes it trivially easy to add any BufferedImage or Icon to your Swing applications. If editable, it also provides a way for the user to change the image. In addition, the JXImagePanel provides many built in effects out-of-the-box, including Tiling , Scaling , Rotating , Compositing , and

Why isn't this element rotation working?

こ雲淡風輕ζ 提交于 2019-12-29 07:44:07
问题 I'm trying to rotate text in IE8. According to this answer, it should be possible to rotate an element as tried in the following example: <!DOCTYPE html> <html> <head> <style> #enclosing { width: 20px; height: 100px; border: 1px solid; } #rotated { -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=6.123031769111886e-17, M12=1, M21=-1, M22=6.123031769111886e-17, SizingMethod='auto expand')"; width: 100px; } </style> </head> <body> <div id="enclosing"> <p id="rotated">rotated</p> </div>

Rotating an object around a fixed point in opengl

倖福魔咒の 提交于 2019-12-29 05:20:11
问题 I have a problem with this openGL code: glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glPushMatrix(); // put current matrix on stack //glTranslatef(0.0f, 0.0f, 0.0f); //glTranslatef(-4*1.5, 0.0, 4*1.5); glRotatef(rotationAngle, 0.0f, 1.0f, 0.0f); // rotate the robot on its y-axis glTranslatef(xpos, ypos, zpos); DrawRobot(xpos, ypos, zpos); // draw the robot glPopMatrix(); What should I do to make my robot turn around the point at which it is currently situated and not around the origin? I

Rotate UIView iPhone

筅森魡賤 提交于 2019-12-29 04:19:27
问题 I am working on a puzzle game and I need to rotate the puzzle pieces to 90 degrees angle on every double tap. I have tried to do did using two different ways. First method is this one: [UIView beginAnimations:@"rotate" context:nil]; [UIView setAnimationDuration:0.5]; self.transform = CGAffineTransformMakeRotation(90); [UIView commitAnimations]; The only problems with that are that the piece is NOT rotating 90 degrees; it is rotating by around 100 degrees, and that this animation is modifying

Three.js Object3d cylinder rotation to align to a vector

夙愿已清 提交于 2019-12-29 03:39:09
问题 I have searched far and wide, but can't seem to figure this pretty basic thing out. I have seen other examples on stackoverflow and elsewhere from a year or two ago, but they fail to work with the latest version of Three.js. Here is a version of what i'm working on: http://medschoolgunners.com/sandbox/3d/. I'm trying to get the grey cone to exactly align with the unlabeled red vector. Ie. I want the tip of the cone to be exactly aligned with the vector and point out from the origin in that

UINavigationController and autorotation

点点圈 提交于 2019-12-29 03:26:10
问题 I have a UIViewController that returns YES in shouldAutorotateToInterfaceOrientation: for UIDeviceOrientationPortrait and NO for everything else. With that view on the top of the stack, I use pushViewController:animated: to push a new UIViewController . The new controller returns YES for anything in shouldAutorotateToInterfaceOrientation: . The first view refuses to rotate (as expected). Once the second view is pushed, the user can rotate the device and the UI will rotate (also as expected).

D3.js animate rotation

…衆ロ難τιáo~ 提交于 2019-12-28 08:39:26
问题 I'm having trouble when I try to correctly execute a rotation animation using the D3.js library. The problem has to do with the point at which I want to rotate the element about. Here is a fiddle I made to show what I mean (in slow motion): http://jsfiddle.net/74mCb/ It seems like the source of the problem lies here: .attr("transform", "rotate(-60, 150,130)"); And then I rotate it like so: .attr("transform", "rotate(40 150,130)"); I would like the butt of the needle to stay in position (to be