## 3D position of a point in 3D plane having local 2D coordinates of the point

Nibbie
Posts: 2
Joined: 2010.06
Post: #1
Hi all!
I need to visualize the tangents planes of my mesh.
I got the tangents normals. Then having the point of the tangent plane and having the tangent normal for that point(the normal of the tangent plane), having that, I need to draw an shape of an square in the tangent plane.
Let tell the point is (x:4; y:3; z:5)
Let the normal be (nx:2; ny:4; nz:3)
And finally let the local(local to the tangent plane), let the square 4 local points be (ax:2; ay:2), (bx:-2; by:-2), (cx:-2; cy:2) and (dx:2; dy:-2).
Omiting the projection of 3D to 2D, I want to knoh how to calculate the 3D positions of the four points of the square.

I hope I exposed clearly my problem.

And another thing. I need the maths to achieve this, not serving me transform matrixs and GPU programing stuff, because I'm programing to the CPU.

Thanks a lot for any help.
Apprentice
Posts: 19
Joined: 2010.03
Post: #2
If you know two points on your tangent plane you can construct a matrix:

p1 - the point you know (where the tangent touches the mesh)
p2 - another arbitrary point in the plane (a near mesh vertex projected on to the plane)
N - the normal.

we can construct the matrix thus:

x = normalized(p2-p1)
z = normalized(N)
y = cross(x, z)
t = p1

where x,y,z and t are the rows (or columns) of your matrix. This will describe the plane in mesh space of the tangent.

Does that make sense?
Nibbie
Posts: 2
Joined: 2010.06
Post: #3

Actually I wont to do things without any matrix. There are a lot of libraries and classes I could use. But wont not. I know this not make sense,but won't to use matrixs.

At now I have the equation of a plane: nx(p1:x-p2:x)+ny(p1:y-p2:y)+nz(p1:z-p2:z)=0
The thing I will try is to plot known values to extract the unknowns.For a plane who match one of the axis I guess I know how to make it.But for a randomly positioned plane

Anyway, thank you for the answer!
Sage
Posts: 1,482
Joined: 2002.09
Post: #4
You don't need to use a matrix library to multiply by a matrix. If you implement only the parts you need you'll only need a few 10 line matrix handling functions.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.