Tag Info

New answers tagged

1

It depends on the coordinate system you're working in. In a right-handed coordinate system (eg. x right, y up, z points toward the viewer), the right-hand rule applies, as mklingen describes in the existing answer. In a left-handed coordinate system (eg. x right, y up, z points away from the viewer), the left-hand rule applies - you point your left thumb ...


1

Quaternions are not axis/rotation vectors. That's just not how they work. They do encode an axis/rotation, but not in the way you describe. Check out the equation from wikipedia: Given an axis [a_x, a_y, a_z] and angle theta, q = [a_x * sin(theta / 2), a_y * sin(theta / 2), a_z * sin(theta / 2), cos(theta / 2)] That said, if you do have an axis/rotation ...


0

Here's the approach I would use. No rotations at all, just projections: For the face you want to solve, take the cross product of two outer edge vectors. This is your normal vector. With your normal vector and the distance from the origin, you now have the face plane in Hessian normal form. ax + by + cz + d = 0 Calculate the barycentric coordinates of ...


0

(Posting my comment as an answer) If you take the 3d plane for your cell and the line for that south pole, and find the intersection point, then you could use LookAt for that point. You would also want to handle the case where the plane is parallel to that line, in which case you could rotate the plane to a predetermined angle, to orient it correctly.


0

After quite a headache and a lot of fumbling about, I have finally solved this using the WPF libraries - WindowsBase.dll, PresentationCore.dll - for vectors, rotation, translation, etc. Also some correction to handling facing: public static void MoveEntity (Guid EntityId, Direction Direction) { var entityVector = default(IEntityVector); var ...


1

If you look at a circle with the angles marked you will see that 270 degrees corresponds with (0,-1) i.e. straight down. By convention degrees are marked as acceding in a counter-clockwise direction. They do however form a loop and as such 270 degrees (purple arrow) can also be expressed as -90 degrees (orange arrow) i.e. a quarter turn in the opposite ...


0

X = x*cos(θ) - y*sin(θ) Y = x*sin(θ) + y*cos(θ) This will give you the location of a point rotated θ degrees around the origin. Since the corners of the square are rotated around the center of the square and not the origin, a couple of steps need to be added to be able to use this formula. First you need to set the point relative to the origin. Then you ...


0

It is a common technique to rotate a point about a pivot by translating to a coordinate system where the pivot is the origin, then rotating about this origin, then translating back to world coordinates. (A very good explanation of this approach is available at Khan Academy) However you are not storing your rectangle corners in world coordinates so we can ...


0

See the Wikipedia article on rotation. The essence is this: (1) If c is the center point, then the corners are c + (L/2,W/2), +/- etc., where L and W are the length & width of the rectangle. (2) Translate the rectangle so that center c is at the origin, by subtracting c from all four corners. (3) Rotate the rectangle by 40 deg via the trig formulas ...


0

Your task is to find the forward vector (the blue one) that is pointing towards the other player. This vector can be approximated by finding the tangent at the player position on the shortest arc between the player and the enemy. The tangent of the arc between the two players can be approximated using an approximated derivative (delta). So should we ...



Top 50 recent answers are included