java3dgame-enginecartesian-coordinates

Custom 3D graphics engine... where to plot Z coordinate


I'm brainstorming a way to create a basic custom 3D engine by myself and it's all very new to me, as I've only practiced 2D graphics.

Assuming that we have calculations for a Z coordinate using the recommended formulas given here, how might I go about plotting the Z coordinate? I understand that by default, Java graphics draw on a 2D field, which means that the only coordinates I can draw to is either the X or Y coordinate... and that's where I'm stuck.

3D development is not taught in my college... so I really appreciate good feedback. The tutors here never practiced creating 3D engines, so I'm very frustrated because learning this concept is crucial.


Solution

  • In order to map 3D coordinates to a 2D plane (the screen) you'll need to understand the concept of the Frustum and how to utilize a Projection Matrix.

    Frustum in 3D space with near and far clipping planes

    This article does an excellent job of explaining what it does and how to implement one. Writing your own engine for this seems to be a massive undertaking and assumes you understand the vector and matrix mathematics. If not, I would suggest doing some reading on linear algebra; it's fundamental to this kind of programming.

    If you'd like to work with some already established technologies, look into OpenGL for Java.