# Thread: Formula for 3D glasses - perpendicular intersecting vectors

1. ## Formula for 3D glasses - perpendicular intersecting vectors

Hello all!

n00b here, and I hope I'm posting in the right thread
I'm trying to work out a formula that I'm going to be using in a C# program to generate a cyan/red anaglyph display of a 3D world.

I need an algorithm to calculate an x,y,z coordinate in 3D space..

- you are given points P and T and O
- we know OP ┴ PN (always perpendicular)
- we know TP ┴ PN (always perpendicular)
- you are given a magnitude of X
- the length of PN is X
- find point N

Of course with the information given, there are two possible solutions for N.
I need them both

That's me! I was testing my shader math in photoshop

2. after doing research all night long I've learned that all I'm looking for is the cross product of the two original vectors.
Fortunately XNA includes this function, so it's as easy as Vector3 PN = Vector3.Cross(OP, TP);
now I'm gonna find a function that'll find a point on this vector given an origin and a magnitude