3D position of a point in 3D plane having local 2D coordinates of the point
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.
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.
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(p2p1)
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?
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(p2p1)
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?
Thank you to the reply.
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:xp2:x)+ny(p1:yp2:y)+nz(p1:zp2: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!
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:xp2:x)+ny(p1:yp2:y)+nz(p1:zp2: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!
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.
Possibly Related Threads...
Thread:  Author  Replies:  Views:  Last Post  
Floating point oddities  Skorche  9  4,689 
Oct 23, 2006 10:39 AM Last Post: DoG 

Point system logic  C++ & Open GL  skrew  5  4,879 
Nov 16, 2005 01:43 AM Last Post: qmadd 