1

I'm working on a 3D engine using only the standard python libraries. I'm using Tkinter to display points. I'd like to convert a given 3D (x, y, z) point to a 2D (x, y) coordinate to be displayed on a screen by drawing a line from one to the other. I have tried searching online for how to do this but the answers don't seem to cover for all of my inputs. I'd like to get a function that uses

  • Camera X
  • Camera Y
  • Camera Z
  • Camera Rotation X
  • Camera Rotation Y
  • Point X
  • Point Y
  • Point Z

to produce my 2D coordinate. I don't really have any code to show since nothing I tried got close to doing what I want. Thanks

Reblochon Masque
  • 35,405
  • 10
  • 55
  • 80
Decode0007
  • 23
  • 4
  • 1
    This essentially is a general math/geometry question, and not really about programming, since the same technique for projecting 3d points on to a 2d plane would be used regardless of the language. There are a lot of articles and tutorials on the subject, so can you explain why none of those helped and why you're asking here? There are questions on this site like [this one](https://stackoverflow.com/q/23472048/6273251) or [this one](https://stackoverflow.com/q/724219/6273251) which ask essentially the same thing. – Random Davis Nov 29 '21 at 18:04
  • 1
    Wikipedia [3D projection](https://en.wikipedia.org/wiki/3D_projection). It shows `Mathematical formula` to convert 3D to 2D. `a` is 3D point, `c` is camera, `b` in `2D` – furas Nov 29 '21 at 20:04
  • You said "from one to the other". What is the "other"? – Tim Roberts Nov 30 '21 at 00:31

0 Answers0