Maths - Vectors

By: Nobody/Anonymous - nobody
file Inversion of line on plane projection  
2005-07-16 02:07

Hi Martin. I'm trying to calculate the normal vector of a plane based on a known projection of a known 3D vector onto the plane.  
 
Basically, I'm looking for the equation of a ray going from the closest point of a 3d cube (rendered to 2D projection) to my camera. I'm using the convention that this point is positioned at (0,0,0). Other visible points of the cube are at (1,0,0), (0,-1,0), (0,0,-1) and so forth. This would be simple were it possible to invert the cross product but i'm having a brain block. I hope this makes sense. Any ideas would be greatly appreciated. Thanks! 
 
Jesse

By: Martin Baker - martinbakerProject Admin
file RE: Inversion of line on plane projection  
2005-07-16 08:14

Hi Jesse, 
 
There is no unique inverse of the vector cross product, this is not a deficiency with vector arithmetic, the same thing happens if we use equivalent matrices as shown here: 
https://www.euclideanspace.com/maths/algebra/matrix/functions/skew/ 
 
This is accurately modeling the real world because if we cross multiply A x B to get a mutually perpendicular vector C, then we try to invert the problem to say that we know A and C and we want to find B we find that there are many values of B that will give us the answer we want so there is no solution. 
 
If your problem does have a unique solution there must be a way to formulate it without using inverse cross product, or where the inverses cancel out? 
 
Perhaps you could use projections of lines on planes or normals of lines to planes as shown here: 
https://www.euclideanspace.com/maths/geometry/elements/plane/lineOnPlane/ 
 
Martin

By: Nobody/Anonymous - nobody
file RE: Inversion of line on plane projection  
2006-01-15 00:51

 
Formulate the cube as it's dual, ie with planes. 
You have the center vector C and the axis-normals to the cube faces A[3], such that the 8 vertices of the cube are 
 
V[0..7] = C +/- A[0] +/- A[1] +/- A[2] 
 
Project these points onto the camera direction Z. 
 
projection[0..7] = dot( V[0..7], Z ) = dot( C, Z ) +/- dot( A[0], Z ) +/- ... etc 
 
The most extremal point along axis Z is obviously the one with all positive dot products, and the opposite the one with all negatives. 
 
Thus, the closest point of cube C into the opposite direction of the camera is 
 
C - A[0] * abs( dot( A[0], Z ) ) - A[1] * abs( dot( A[1], Z ) - A[2] * abs( dot( A[2], Z ) ) 
 
 


metadata block
see also:
Correspondence about this page

Book Shop - Further reading.

Where I can, I have put links to Amazon for books that are relevant to the subject, click on the appropriate country flag to get more details of the book or to buy it from them.

cover Introduction to 3D Game Programming with DirectX 9.0 - This is quite a small book but it has good concise information with subjects like, maths introduction and picking.

cover Mathematics for 3D game Programming - Includes introduction to Vectors, Matrices, Transforms and Trigonometry. (But no euler angles or quaternions). Also includes ray tracing and some linear & rotational physics also collision detection (but not collision response).

Other Math Books

Terminology and Notation

Specific to this page here:

 

This site may have errors. Don't use for critical systems.

Copyright (c) 1998-2023 Martin John Baker - All rights reserved - privacy policy.