Tough math problem, can someone help?

Started by
7 comments, last by Max_Payne 20 years, 1 month ago
So here it is. Its not that tough, its just that nobody seems to *know* how to do it. I will try to express this as clearly as I can. I have a plane in 3D space, the plane can be facing any direction. I also have a *3D* point which I know lies on the plane, which I will call Point1. I also have another 3D point, which I will call Origin, along with two orthogonal 3D vectors which lie on the plane (XVector and YVector). The two orthogonal vectors and the 3D Origin point form a base in the plane's 2D space. The plane's normal is also known. Basically, since the 3D point I talked about earlier lies on the plane, we have that: Point1 = Origin + X * XVector + Y * YVector This can be further simplified, since we know Point1 and Origin: Point2 = Point1 - Origin Point2 = X * XVector + Y * YVector So, Point2 is a linear combination of the two *3D* vector. Basically, what I need to know, is the value of X and Y. This is sort of a projection of the original 3D point (Point1) in the plane's 2D space coordinate system... A linear algebra problem. Can anyone help?
Looking for a serious game project?
www.xgameproject.com [edited by - Max_Payne on February 22, 2004 1:42:04 AM]

Looking for a serious game project?
www.xgameproject.com
Advertisement
X = ((P1-O).XVector) / ||XVector||
Y = ((P1-O).YVector) / ||YVector||

No ?
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
I dont really know, but wouldnt it be ironic if I did?
Rate me up.
Testing what Fruny suggested....

If my forward raytracer manages to generate a correct image, then it should be fine


Looking for a serious game project?
www.xgameproject.com

Looking for a serious game project?
www.xgameproject.com
Doesn''t seem to work... So if anybody else has a suggestion.

Tommorow I will take the time to see if the error is in my code.


Looking for a serious game project?
www.xgameproject.com

Looking for a serious game project?
www.xgameproject.com
Well, if I understand you correctly.. you have and equation in 3 dimensions with 2 unknowns... as long as the two vectors are linearly independant (which we assume they are) then taking any 2 of these dimensions, gives you enough information to some for the two variables... ie 2 linear equations in 2 unknowns. Should be easy enough? Exactly the same method would be applicable to your original equation too. The chances are (if you absolutely need the formula in more general vector notation) the result will become clear after obtaining the solution in this way.
quote:Original post by Fruny
X = ((P1-O).XVector) / ||XVector||
Y = ((P1-O).YVector) / ||YVector||

No ?


Fruny was close to the answer... It was:

X = ((P1-O).XVector) / ||XVector||^2
Y = ((P1-O).YVector) / ||YVector||^2

quote:Well, if I understand you correctly.. you have and equation in 3 dimensions with 2 unknowns... as long as the two vectors are linearly independant (which we assume they are) then taking any 2 of these dimensions, gives you enough information to some for the two variables... ie 2 linear equations in 2 unknowns. Should be easy enough? Exactly the same method would be applicable to your original equation too. The chances are (if you absolutely need the formula in more general vector notation) the result will become clear after obtaining the solution in this way.


Thats mathematically incorrect. Just doesn''t work. All 3 dimensions need to be taken into account.


Looking for a serious game project?
www.xgameproject.com

Looking for a serious game project?
www.xgameproject.com
quote:Original post by Max_Payne
Fruny was close to the answer... It was:

X = ((P1-O).XVector) / ||XVector||^2
Y = ((P1-O).YVector) / ||YVector||^2


Oh, yeah, duh. Silly me.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
quote:Original post by Fruny
quote:Original post by Max_Payne
Fruny was close to the answer... It was:

X = ((P1-O).XVector) / ||XVector||^2
Y = ((P1-O).YVector) / ||YVector||^2


Oh, yeah, duh. Silly me.


Well you did put me on the right track, thanks


Looking for a serious game project?
www.xgameproject.com

Looking for a serious game project?
www.xgameproject.com

This topic is closed to new replies.

Advertisement