rotation

Unity; Random Object Movement [closed]

会有一股神秘感。 提交于 2020-01-04 06:09:11
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . I am making a robot battling game where I want the enemy to randomly move and then sometimes travel towards the enemy. Code that I want the movement to be in. else if (avoid == false) { transform.LookAt(target); transform.Translate(Vector3.forward * Time.deltaTime * movementSpeed)

CSS rotated text with background shows some background-issues

孤者浪人 提交于 2020-01-04 04:46:09
问题 I am using CSS to slightly rotate Text. The text is black on a white background, but because of the rotation part of the background has some little transparent lines going through it. This image will show it more clearly: body { background: red; } .featured-grid-b .item-heading { /*Black text on white background*/ box-shadow: 0 0 0 5px #fff; padding: 0; background: #fff; line-height: 2 !important; display: inline; color: #000; text-shadow: none; } .caption h3 { /*Rotate Text*/ transform:

Issue with GLM Camera X,Y Rotation introducing Z Rotation

雨燕双飞 提交于 2020-01-04 04:41:06
问题 So I've been having trouble with a camera I've implemented in OpenGL and C++ using the GLM library. The type of camera I'm aiming for is a fly around camera which will allow easy exploration of a 3D world. I have managed to get the camera pretty much working, it's nice and smooth, looks around and the movement seems to be nice and correct. The only problem I seem to have is that the rotation along the camera's X and Y axis (looking up and down) introduces some rotation about it's Z axis. This

Rotation of a point about the z-axis

时光毁灭记忆、已成空白 提交于 2020-01-03 22:56:10
问题 I have 3 vectors in 3D space. Let's call them xaxis , yaxis , and zaxis . These vectors are centered about an arbitrary point somewhere in 3D space. I am interested in rotating the xaxis and yaxis vectors about the zaxis vector a number of degrees θ . For the following code with values being arbitrary and unimportant: double xaxis[3], yaxis[3], zaxis[3], point[3], theta; How would I go about rotating xaxis and yaxis about the zaxis by theta degrees? Future Note: These attempts do not work.

How to rotate a polygon around a point with Java?

假如想象 提交于 2020-01-03 20:05:17
问题 I'm creating a Canvas object ( lines, vertices, triangle, ...) and I would like to apply to them a rotation around a point. I can't use the rotate() method of Canvas because points are attached to GeoPoint on a Map, so if I use the rotate() method the all map is rotating ... The problem is that Canvas needs Point(int,int) and applying a rotation creates double because of cos and sin functions. So when I apply the rotation to the all points, because of casting double to int, I have some

Rotate UIImage custom degree

柔情痞子 提交于 2020-01-03 17:09:07
问题 I want to rotate an UIImage (not UIImageView) in custom degree I followed this post but it didn't work for me. Anyone can help? Thanks. UPDATE: The code below does some of the job, but I lose some of the image after rotating it: What should I change to get it right? (btw the yellow color in the screenshots is my UIImageView bg) - (UIImage *) rotate: (UIImage *) image { double angle = 20; CGSize s = {image.size.width, image.size.height}; UIGraphicsBeginImageContext(s); CGContextRef ctx =

PDFKit: PDFView doesn't resize when device rotated

拈花ヽ惹草 提交于 2020-01-03 15:53:15
问题 I have an iPad app displaying a PDFView. The app is rotatable to any orientation. The PDFView is full-screen and single-page. The PDF displays as expected when launched in either orientation; the entire first page is visible, zoomed to fit the screen without any of the PDF appearing off-screen. The PDF will always be a US-letter-size document. When rotated, the PDF rotates, but does not resize. When rotated landscape-to-portrait the PDF is displayed "too small" - with a huge empty border

How to retrieve the 3D rotation angle on each axis?

拟墨画扇 提交于 2020-01-03 15:19:05
问题 I have a Model3DGroup which is rotated around any of the x, y, z axis using an AxisAngleRotation3D applied on the Transform property of the object. The problem is that I am not in control of the various rotations applied on the mesh. I need to display the angle of the mesh on each of the x, y, z axis at each render loop. How can I do that? I tried retrieving the AxisAngleRotation3D object on the object, but it only gives me the rotation that was last applied. Which is not correct. If for

Finding rotation between two congruent triangles

风格不统一 提交于 2020-01-03 12:22:10
问题 I'm working on a 3D mesh parsing tool. Currently, I'm trying to determine the rotation between two congruent triangles in 3D space—we'll call them ABC and DEF . I'm able to translate points A and D to the same location and now need to determine a rotation that would place DEF on the same plane and in the same orientation as ABC but I'm not familiar enough with the math to do it. Can anyone tell me how I can tackle this? I've been thinking of using the cross product of AB and DE to determine a

Set an object's absolute rotation around the world axis

人走茶凉 提交于 2020-01-03 08:42:11
问题 Update: Added a jsfiddle to illustrate: JSFiddle I have an object ( a cube ) that is placed in the scene. My goal is to be supplied 3 angles which represent an object's orientation in the real world. The angles will be measured against real-world X, Y and Z axis. What I am failing (miserably) is how to give an object these angles and then as the data changes, set the object to receive a new triplet of angles. What I seem to be finding is that when I set an initial set of angles, all is good,