Not logged in, Join Here! or Log In Below:


Well, the problem is hard to explain without the right terminology.
GIVEN  I have a line AB defined by 2 3DVec's A,B and the rotation rot(x,y,z).  I have a 3D plane P  the line AB intersects the plane P RESULT  Result is NOT *coplanar* with P. Point B is 'sitting' on P.  Rotating around A  'rot' is a vec3d (x,y,z) How much x(x,y,z) must I rotate AB around A (rot(x,y,z) representing the current rotation) to have AB 'sitting' on plane P? AB doesn't change. Ok, think this is the right way to put it. Bless for looking at my problem. 

If your Rot is not parallel to the plane P, then you have a badlly defined problem, because you don't have a single solution, but many instead. (assuming Rot is a rotation point => 3 degrees of freedom). 

Ok, A has only 1 rotation axis (ortho to monitor). In this case. 

Well, You haven't really clarified your problem, but by reading your descriptions, I'm not sure if this is a 2D or 3D problem. You mention a plane, which could lead to 3D, but you also seem to be representing a plane with a line, and assuming it is also orthogonal to monitor as the axis. So not sure, but your post subject is 3D. 

GIVEN
We're in 3D AX must = AB (AB must stay the same length) The rotations rot and x are planar rotations on A's local (rot+x,0,0) axis. I'd rather have a general sollution on an arbitrary rotation axis relative to the world, though. X is also a point I have to calculate. I must find X first(there should be 2 sollutions) and then calculate Beta the way you did. But how do I find X ??? I must rotate AB around A for x amount on A's loc x axis until AB is 'sitting' on the plane. 

... I'd rather have a general sollution on an arbitrary rotation axis relative to the world, though. That is very easy, once you have the local rotation ! You just have to create a Matrix with the following transforms:  Translate From LOCAL origin (C) to World Origin  Rotate  Translate back to C X is also a point I have to calculate.
I must find X first(there should be 2 sollutions) and then calculate Beta the way you did.
You don't have to calculate X, to find the angle to rotate AB! But after you know the angle, you can use Point (A) and the angle and the length of AB to find X. But how do I find X ???
I must rotate AB around A for x amount on A's loc x axis until AB is 'sitting' on the plane.
I think the previous explanation already gave you enough tips to find it out. Some reasoning here:  You know the length of AB  You can Determine the distance from A to the plane  You can project line AB into the plane, (2 constrains already solved for X)  You can determine the Length of the previous projection into the plane. So basicly you have all the side lengths of the triangle defined by:  line AB (after the targeted rotation),  distance from A to plane.  projection of line AB on plane Use the Pythagoras Theorem and the Internal Angles Add to 180 Degrees, and you should reach your intended result. Resuming in simple terms: Knowing the hipotenusa of the triangle (Length of Line AB), and one of it's sides (Distance from A to plane), you can determine Beta using the formula I mentioned before. Then as I said before Calculate BetaAlfa ! Remember however that if the rotation axis is not paralell with the plane, you will have to change the equation, by adding another COS(Teta) or SIN(Teta) (depending on how you measure it), on the left side of the equation. Teta will be the angle formed between the Rotation axis and the plane, or plane normal. 

Major thx, Riu 

Major thx, Riu Actually it's Rui, Not Riu, that is a Robot character from Japanese commics I believe 8) I see which in direction i have to look for the sollution... Great that was the ideia ! ...
Don't see why I need the projection of AB on P. It's NOT the 3rd side of the orthotriangle (it's too short but maybe I need its orientation???). Forget that if you only want the Angle of rotation, use the section I named "Resuming in Simple Terms". That was to calculate X directly, but thinking about it, you are right, it's too short, at least in the case where AB isn't CUT, this is it stays the same length. Actually what you should have asked was that you wanted to rotate point B using A as center, so that B layed on the Plane, Not X, that confused things. Do 2 lengths AB and AP define an orthotriangle? (I guess yes) But what about the angles? A normal by definition is Orthogonal to the plane, hence it makes a 90 degree angle with it! "Knowing the hipotenusa of the triangle (Length of Line AB), and one of it's sides (Distance from A to plane), you can determine Beta using the formula I mentioned before." (Which one ???). Not paying much attention are you ? One or Two posts back. Quoting PS: It's a shame this forum doesn't support images. Me not being too familiar with the terminology, a diagram would be better than a thousand words. If you really need an image, there are sites just for that! I believe one is called imageshack, and they are free. Just search arround the net, and after posting the image on those sites, just post a message with a link to it, here on Flipcode. 
