How to convert 3d co ords to 2d orthographic?

In summary, the conversation discusses a method for determining the field of view and distance from the screen based on a given angle. The formula involves measuring the distance from the screen and using that to calculate the field of view. There may be limitations to this method, but it should work in general.
  • #1
rollcast
408
0
I'm still looking into this prior to my older thread and someone has told me of a method that I have quoted below;

"
All measurements are assuming that the pixel width/height is one)

Let fov = the field of view, you can decide how much field of view your user will have from the target viewing point. For example, if you look at your screen and say that there is 30 degrees between the edges of your screen from the target viewing area, then 30 is your fov.

Let d = (screen width / tan(fov)) to the nearest integer.

Given the 3D point [x,y,z]

Your 2D point is [x * d/z, y * d/z] where z is the pixels from 0 being the screen to 1000 being A kilometer away from your screen (of course, all virtually) Here's in example:

Let my screen be 20 pixels wide.

Make a V with my hands by placing my palms together, point the edges of my hands to the edges of my screen as shown on my computer monitor, and estimate the angle to be thirty degrees (Of course this will be different with different monitors, so there should be a suggested monitor width) Then:

d = 20 / tan 30 ~= 35 (This should be pretty close to the actual distance the user is from the screen!)

Now, Given the point [x,y,z]

My 2D point is [x * 35 / z, y * 35 / z]

"

Will this work or does it have any limitations?

Thanks
AL
 
Mathematics news on Phys.org
  • #2
Yes, that will that will work but I don't quite see why you are doing it. You appear to be calculating the distance from the screen by using a given angle. It is the distance from the screen that is the more direct measurement and one would normally calculate the "fov" from that.
 

FAQ: How to convert 3d co ords to 2d orthographic?

1. How do I convert 3D coordinates to 2D orthographic?

To convert 3D coordinates to 2D orthographic, you will need to project the 3D points onto a 2D plane. This can be done using a projection matrix, which involves multiplying the 3D points by a transformation matrix. The resulting 2D points will be the orthographic projection of the original 3D points.

2. What is the difference between 3D coordinates and 2D orthographic coordinates?

3D coordinates have three components (x, y, z) that represent a point in a three-dimensional space, while 2D orthographic coordinates have only two components (x, y) that represent a point in a two-dimensional space. The z component in 3D coordinates represents depth, while the z component in 2D orthographic coordinates is ignored as the projection is flattened onto a 2D plane.

3. Can I use any projection matrix to convert 3D coordinates to 2D orthographic?

No, not all projection matrices will result in an orthographic projection. The projection matrix must be specifically designed for orthographic projection, which involves setting the z component to 0 and keeping the x and y components intact. Using a different projection matrix may result in a different type of projection, such as perspective projection.

4. What is the purpose of converting 3D coordinates to 2D orthographic?

Converting 3D coordinates to 2D orthographic can be useful for creating 2D representations of 3D objects, such as in computer graphics or engineering drawings. It can also be used for simplifying calculations and visualizations, as working in a 2D plane is often easier than working in a 3D space.

5. Are there any limitations to using 2D orthographic coordinates?

Yes, 2D orthographic coordinates do not accurately represent the depth or perspective of objects in a 3D space. This can make it difficult to accurately represent the size or shape of objects. Additionally, objects that are far away from the viewing plane may appear distorted in the 2D orthographic projection.

Similar threads

Replies
17
Views
1K
Replies
5
Views
2K
Replies
2
Views
2K
Replies
1
Views
375
Replies
2
Views
4K
Replies
1
Views
2K
Replies
2
Views
1K
Back
Top