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

  • Context: Undergrad 
  • Thread starter Thread starter rollcast
  • Start date Start date
  • Tags Tags
    2d 3d Convert
Click For Summary
SUMMARY

The discussion focuses on converting 3D coordinates to 2D orthographic projections using a method that incorporates the field of view (fov) and screen dimensions. The formula provided states that for a given 3D point [x,y,z], the corresponding 2D point can be calculated as [x * d/z, y * d/z], where d is derived from the screen width and the tangent of the fov. The example illustrates this with a 20-pixel wide screen and a 30-degree fov, resulting in d being approximately 35. The conversation also highlights a potential limitation in calculating fov based on distance from the screen rather than the angle.

PREREQUISITES
  • Understanding of 3D coordinate systems
  • Familiarity with trigonometric functions, particularly tangent
  • Knowledge of orthographic projection techniques
  • Basic experience with programming or mathematical modeling
NEXT STEPS
  • Research "3D to 2D projection algorithms" for further methods
  • Explore "trigonometric functions in computer graphics" for deeper insights
  • Learn about "orthographic vs perspective projection" to understand differences
  • Investigate "field of view calculations in graphics programming" for practical applications
USEFUL FOR

This discussion is beneficial for computer graphics developers, game developers, and anyone involved in 3D modeling or rendering who seeks to understand the conversion of 3D coordinates to 2D representations.

rollcast
Messages
403
Reaction score
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
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.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
17
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 9 ·
Replies
9
Views
18K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 6 ·
Replies
6
Views
3K