reverseprojection

Ray intersection with 3D quads in XNA?

会有一股神秘感。 提交于 2020-01-11 09:43:09
问题 So I have successfully made a ray the represents the mouse unprojected into the world, and now I need to check if that ray can intersect with a quad object, here is the code I use to get the ray: public Ray GetMouseRay() { Vector2 mousePosition = new Vector2(cursor.getX(), cursor.getY()); Vector3 nearPoint = new Vector3(mousePosition, 0); Vector3 farPoint = new Vector3(mousePosition, 1); nearPoint = viewport.Unproject(nearPoint, projectionMatrix, viewMatrix, Matrix.Identity); farPoint =

proportions of a perspective-deformed rectangle

早过忘川 提交于 2019-12-28 01:43:09
问题 Given a 2d picture of a rectangle distorted by perspective: I know that the shape was originally a rectangle, but I do not know its original size. If I know the pixel coordinates of the corners in this picture, how can I calculate the original proportions, i.e. the quotient ( width / height ) of the rectangle? (background: the goal is to automatically undistort photos of rectangular documents, edge detection will probably be done with hough transform) UPDATE: There has been some discussion on

Reverse-projection 2D points into 3D

放肆的年华 提交于 2019-12-03 05:11:11
问题 Suppose we have a 3d Space with a plane on it with an arbitary equation : ax+by+cz+d=0 now suppose that we pick 3 random points on that plane: (x0,y0,z0) (x1,y1,z1) (x1,y1,z1) now i have a different point of view(camera) for this plane. i mean i have a different camera that will look at this plane from a different point of view. From that camera point of view these points have different locations. for example (x0,y0,z0) will be (x0',y0') and (x1,y1,z1) will be (x1',y1') and (x2,y2,z2) will be

Reverse-projection 2D points into 3D

℡╲_俬逩灬. 提交于 2019-12-02 18:25:40
Suppose we have a 3d Space with a plane on it with an arbitary equation : ax+by+cz+d=0 now suppose that we pick 3 random points on that plane: (x0,y0,z0) (x1,y1,z1) (x1,y1,z1) now i have a different point of view(camera) for this plane. i mean i have a different camera that will look at this plane from a different point of view. From that camera point of view these points have different locations. for example (x0,y0,z0) will be (x0',y0') and (x1,y1,z1) will be (x1',y1') and (x2,y2,z2) will be (x2',y2') from the new camera point of view. So here is my a little hard question! I want to pick a

Ray intersection with 3D quads in XNA?

雨燕双飞 提交于 2019-12-01 22:38:53
So I have successfully made a ray the represents the mouse unprojected into the world, and now I need to check if that ray can intersect with a quad object, here is the code I use to get the ray: public Ray GetMouseRay() { Vector2 mousePosition = new Vector2(cursor.getX(), cursor.getY()); Vector3 nearPoint = new Vector3(mousePosition, 0); Vector3 farPoint = new Vector3(mousePosition, 1); nearPoint = viewport.Unproject(nearPoint, projectionMatrix, viewMatrix, Matrix.Identity); farPoint = viewport.Unproject(farPoint, projectionMatrix, viewMatrix, Matrix.Identity); Vector3 direction = farPoint -

proportions of a perspective-deformed rectangle

时光怂恿深爱的人放手 提交于 2019-11-27 02:51:31
Given a 2d picture of a rectangle distorted by perspective: I know that the shape was originally a rectangle, but I do not know its original size. If I know the pixel coordinates of the corners in this picture, how can I calculate the original proportions, i.e. the quotient ( width / height ) of the rectangle? (background: the goal is to automatically undistort photos of rectangular documents, edge detection will probably be done with hough transform) UPDATE: There has been some discussion on whether it is possible at all to determine the width:height ratio with the information given. My naive

How do I reverse-project 2D points into 3D?

北战南征 提交于 2019-11-27 02:41:55
I have 4 2D points in screen-space, and I need to reverse-project them back into 3D space. I know that each of the 4 points is a corner of a 3D-rotated rigid rectangle, and I know the size of the rectangle. How can I get 3D coordinates from this? I am not using any particular API, and I do not have an existing projection matrix. I'm just looking for basic math to do this. Of course there isn't enough data to convert a single 2D point to 3D with no other reference, but I imagine that if you have 4 points, you know that they're all at right-angles to each other on the same plane, and you know

How do I reverse-project 2D points into 3D?

荒凉一梦 提交于 2019-11-26 10:07:49
问题 I have 4 2D points in screen-space, and I need to reverse-project them back into 3D space. I know that each of the 4 points is a corner of a 3D-rotated rigid rectangle, and I know the size of the rectangle. How can I get 3D coordinates from this? I am not using any particular API, and I do not have an existing projection matrix. I\'m just looking for basic math to do this. Of course there isn\'t enough data to convert a single 2D point to 3D with no other reference, but I imagine that if you