#### Archived

This topic is now archived and is closed to further replies.

# Tough math problem, can someone help?

This topic is 5353 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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]

##### Share on other sites
X = ((P1-O).XVector) / ||XVector||
Y = ((P1-O).YVector) / ||YVector||

No ?

##### Share on other sites
I dont really know, but wouldnt it be ironic if I did?

##### Share on other sites
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

##### Share on other sites
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

##### Share on other sites
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.

##### Share on other sites
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

##### Share on other sites
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.

##### Share on other sites
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

1. 1
Rutin
29
2. 2
3. 3
4. 4
5. 5

• 13
• 13
• 11
• 10
• 13
• ### Forum Statistics

• Total Topics
632960
• Total Posts
3009476
• ### Who's Online (See full list)

There are no registered users currently online

×