[fpc-pascal] Calculating Pixels to represent 3D coordinates

Gustavo Enrique Jimenez gejimenez at gmail.com
Tue Sep 17 22:53:39 CEST 2019


A simple transformation is:

P3D=(X,Y,Z)
P2D=(x,y)

x=X+Y*0.707
y=Y*0.707+Z

I did not tried it, but I think that this is the transformation that
you are looking for.


Gustavo

El mar., 17 sept. 2019 a las 17:37, James Richters
(<james at productionautomation.net>) escribió:
>
> >What exactly are you trying to do? Usually if you’re doing 3D this all happens on the GPU and you get back a color/depth buffer. Maybe you need to know where a 2D coordinate is in 3D space?
>
> What I'm trying to do is much simpler than rendering a 3D object..  All I'm trying to do is display a 3D line drawing or wireframe on the screen.  I don't need it to dynamically rotate or anything, and it doesn't need to show any surfaces, textures, lighting, reflections, or shadows, just give a representation of the XYZ points and lines connecting 2 pair of XYZ coordinates on the screen.   The purpose of this is to show a 3D representation of a CNC tool path including the Z movements.
>
> James
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


More information about the fpc-pascal mailing list