x


How can I rotate an object about an arbitrary pivot point P and axis to face a world position X?

For example, in a 2d world in the xy plane, I have a quad that represents the line AB. I would like to be able to rotate that quad about the z-axis at pivot point A or B so that it always points at position X (like a clock hand but the rotation pivots around a user specified end).

I have a solution for this but it varies depending on which end is selected to be the pivot.

Is there a more general solution?

Many thanks for any help.

more ▼

asked Jul 21 '11 at 03:06 PM

mat gravatar image

mat
126 19 20 25

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first
more ▼

answered Jul 21 '11 at 03:37 PM

DaveA gravatar image

DaveA
26.4k 151 171 256

I've looked at that but it doesn't work for the general solution since the direction of the angle must be calculated and to do that I think a special case is required for each end.

Jul 21 '11 at 04:08 PM mat
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2155
x84

asked: Jul 21 '11 at 03:06 PM

Seen: 1375 times

Last Updated: Jul 21 '11 at 04:08 PM