I hope some people good at maths here so maybe they can solve it.
lets say I am shown a square with four corners and each corner is given a coordinate except for one, which is unknown.
anyone know how to estimate the coordinate for this coordinate, this should work for square at any orientation i.e. (ok a quadrilateral as skewed turns to trapezium) rotation, skewing,.
If you allow non-parallel axes you cannot solve the problem. For example (0,0),(0,1),and (1,1) will yield (1,0) with parallel axes, but it can be (0.3,0.9) or (0.4,0.5) or any other point.
Also, it is important the order of points (0,0),(0,1),and (1,1) will yield (1,0), but (0,0),(1,1),and (0,1) yield (-1,0)
With these assumptions (x1,y1),(x2,y2),(x3,y3) yield (x4,y4) where x4=x3+x1-x2, y4=y1+y3-y2
add a 3rd dimension to your script. Need to build a library yourselves. But it should work.
Also the area could also be your solution, since area change in a specific rate. All you need is calculus work, lot of it.
connect the three points with every possible combination and times the coordinate by -1, x and y.
using three points to make a centre, then use calculus to calculate the length of the line with missing points (when one line increase, the other decrease at some specific rate)
I asked because i am writing a program for corner detection and and object is placed on a square surface, which the program detects the corners of the square surface but i have to rotate the surface as well as the object together, which will cause the object to occlude one of the 4 corners and wanted to find a way i could find out the corner that is occluded.
it will be a trapezium as the view is not on top from the side diagonal so it would appear trapezium the smaller being the further away part.
maybe as at the beginning the corner is known and from there the height can be known and maybe using that height to help find the missing corner but there is a problem that when occluded and the trapezium height changes even by a fraction of a millimeter and the previous height will not be of any good.
Just my 2 cents worth, I don't know anything about the graphics system you are using, just going on my knowledge of vector algebra :
If the polygon is a square in the original world coordinates, then it is easy to calculate the 4th corner - just subtract the vector from points 1 to 2 from point 3.
When one views this square from an angle, it may look like a trapezium, but it is still a square in world coordinates. So just use the World Coords rather any from a new view
There is a Point In Polygon algorithm that basically draws a ray parallel to an axis (it doesn't matter but that is more efficient to calculate), if the ray intersects the polygon an odd number of times, the point is inside the polygon. In 3D, the ray would have to be coplanar with the polygon, which itself needs to be planar. Could be a bit of effort to get that working in 3D as it is a 2D algorithm.
I asked because i am writing a program for corner detection and and object is placed on a square surface, which the program detects the corners of the square surface but i have to rotate the surface as well as the object together, which will cause the object to occlude one of the 4 corners and wanted to find a way i could find out the corner that is occluded.
Might have been more helpful if you asked that at the start :-)
One other question : Does your graphics system have any functions for clipping planes? It might well do it for you.
i got an idea something similar to what disch i will capture the corner where it is most likely to get occluded, write them down so everytime a corner is captured check against the written one and provide the corner for the occluded one.