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

Sven Barth pascaldragon at googlemail.com
Tue Sep 17 17:09:54 CEST 2019


James Richters <james at productionautomation.net> schrieb am Di., 17. Sep.
2019, 16:15:

> I'm curious if Freepascal has any package available that would calculate
> X,Y screen pixels based on 3D  X,Y,Z  data at some given rotations.  I'm
> using Agg-Pas with PTC-Graph in a console application on Windows.   I'm not
> sure what the technical term is for figuring out what pixels are used to
> represent 3D coordinates on a 2D screen, but I'm hoping maybe there is
> something that just does the calculations that I can use in conjunction
> with Agg-Pas and PTC-Graph instead of moving to a complete graphics package.
>

You're essentially looking for a software renderer/rasterizer. Lookup
things like projection matrix and model view matrix.

You can also take a look at the "Ray Tracing in one weekend" books (
https://github.com/RayTracing/raytracing.github.io ) to get a feeling for
what's required.

In the end you might be better served to use a graphics package or at least
OpenGL.

Regards,
Sven

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20190917/ef18a879/attachment.html>


More information about the fpc-pascal mailing list